I\'ve seen usage of Objective-C protocols get used in a fashion such as the following:
@protocol MyProtocol
@required
@property (readonly)
Here's an example of mine that works perfectly, the protocol definition first of all:
@class ExampleClass;
@protocol ExampleProtocol
@required
// Properties
@property (nonatomic, retain) ExampleClass *item;
@end
Below is a working example of a class supporting this protocol:
#import
#import "Protocols.h"
@class ExampleClass;
@interface MyObject : NSObject {
// Property backing store
ExampleClass *item;
}
@implementation MyObject
// Synthesize properties
@synthesize item;
@end