I'm trying to write something similar to this (sorry if the sample is not 100% correct, im just writing off the top of me head):
interface Handler
{
void doSomething ( );
}
otherclass
{
void othermethod ( Handler handler )
{
// Handler do something
}
}
So in ObjectiveC I made the following:
@protocol Handler
- (void) doSomething;
@end
// Other class
- (void) othermethod: (Handler*) handler
{
// Do something
}
But I get the following error on the othermethod declaration line: Expected ')' before hander.
I know there is no syntax error here (I can replace Handler* with NSObject* and the error goes away), so obviously my use of a protocol in this case is incorrect.
Could anyone point me to the proper way of creating a C# like interface?