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'
Try:
- (void) register:(NSObject<MyProtocol>*) cb;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With