Flexible Function calling : NSSelectorFromString

Instead of using a switch for flexible function calling, have you ever tried:

SEL sel = NSSelectorFromString( [NSString stringWithFormat:@"handleElement_%@:", elementName] );

So happy I found the objective-C equivalent…

Posted: February 21st, 2011
Categories: code, objective-c
Tags:
Comments: No Comments.