If you don't need to pass any arguments an easy workaround is to use valueForKeyPath
. This is even possible on a Class
object.
NSString *colorName = @"brightPinkColor";
id uicolor = [UIColor class];
if ([uicolor respondsToSelector:NSSelectorFromString(colorName)]){
UIColor *brightPink = [uicolor valueForKeyPath:colorName];
...
}