You need to see the architecture of the file. You can't put @protocol
like that between @interface
and @end
. Also, @protocol
needs @end
and so do @interface
.
@protocol SampleProtocolDelegate <NSObject>
// Related to SampleProtocolDelegate
@end
@interface MyProtoco : NSObject
// Related to MyProtoco
@end
You can have various protocols/interface, you just need to put them one after the other. They are the the same "level" of declaration:
@protocol SampleProtocolDelegate <NSObject>
// Related to SampleProtocolDelegate
@end
@interface MyProtoco : NSObject
// Related to MyProtoco
@end
@protocol SampleProtocolDelegate2 <NSObject>
// Related to SampleProtocolDelegate2
@end
@interface MyProtoco2 : NSObject
// Related to MyProtoco2
@end
@interface MyProtoco3 : NSObject
// Related to MyProtoco3
@end
@protocol SampleProtocolDelegate4 <NSObject>
// Related to SampleProtocolDelegate4
@end
@protocol SampleProtocolDelegate5 <NSObject>
// Related to SampleProtocolDelegate5
@end
With 2 protocols consecutive and two interfaces too to illustrate the "level".