I want to define one protocol with few properties and need to use those properties in another NSObject subclass. Please give me link or example code. I need that to work wit
@property just says to the compiler that the class is expected to define the methods to match that property.
@protocol MyProtocol
@property (nonatomic, readonly) id someObject;
@property (nonatomic, getter=isAlive) BOOL alive;
@end
Anything implementing that protocol will now need to have
- (id)someObject;
- (BOOL)isAlive;
- (void)setAlive:(BOOL)aBOOL;