ObjectiveC Syntax for Specifying Protocol Name in Method Argument

Posted by live2dream95 on Stack Overflow See other posts from Stack Overflow or by live2dream95
Published on 2010-04-20T14:47:49Z Indexed on 2010/04/20 14:53 UTC
Read the original article Hit count: 1239

Filed under:
|

What's the ObjectiveC syntax for specifying a protocol as an argument in a method?

Say I have 2 protocols, MyProtocol and MyProtocolCB:

@protocol MyProtocolCB <NSObject>
- (void) func;
@end

@protocol MyProtocol <NSObject>
- (void) register:(MyProtocolCB*) cb;
@end

I'm receiving this syntax error: error: expected type-specifier before 'MyProtocolCB'

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa