I use the following code to add a method displayValueto NSObject:
@interface NSObject (MyNSObjectAdditions)
- (NSString*)displayValue;
@end
@implementation NSObject (MyNSObjectAdditions)
- (NSString*)displayValue {
return self.description;
}
@end
This works fine, but in fact, I would prefer displayValue to be a read-only property rather than a method.
What would be the correct syntax for converting displayValueas a property instead of a selector, if possible?
emmby source
share