Define the interface for the category, as well as for the class:
@interface NSObject (RetainProperty)
@property (nonatomic, readonly) BOOL moreThanOneRetain;
@end
@implementation NSObject (RetainProperty)
@dynamic moreThanOneRetain;
-(BOOL)moreThanOneRetain
{
return (1 < [self retainCount]);
}
@end
source
share