Last Updated: February 25, 2016
·
1.457K
· rugginoso

Dynamically call delegate method by name in Objective-C

When you receive messages for example in a chat application, you will probably want to handle them in a delegate.
This code automatically send to the delegate a message named handleCommandName, with the command parameters as message parameter and where CommandName is the command to handle.
For example:

  • (void)handleNick:(NSArray *)parameters { ... }

https://gist.github.com/3383407