I need to pass a method name to @selector(method) inside a loop where the method is a value contained in an array.
[myButton addTarget:self action:@selector(method:) forControlEvents:UIControlEventTouchDown];
How can I define a @selector() inside a loop an avoid having to hard code each @selector(method)? Can I pass in a string value?
You can use either
NSSelectorFromString(), which maps anNSStringto aSEL, or you can usesel_registerName(), which maps achar*to aSEL.