Here you can Follow Two Approach.
1).Here you can make the call to the
color Method by passing the Name of these coming Colors.
Scott explain in his Answer.
NSString *colorFromWeb = @"Red"; // for example
NSString *selectorName = [NSString stringWithFormat:@"%@Color", [colorFromWeb lowercaseString]];
SEL selector = NSSelectorFromString(selectorName);
if ([UIColor respondsToSelector:selector])
UIColor *color = [UIColor performSelector:selector]; // Equivalent to [UIColor redColor];
2).In Above way you may face some trouble suppose you got some
color name form Your
WebService which is not exist in
UIColor Class then in that case you can not get that desirable color or might be your app could crashed etc.
Here I would Suggest you you should ask the
RGB float Values From your
Webservice Provider.In this way You can easily pass These
RGB and can make
Color with these
Here is Some Demo.
[UIColor colorWithRed:redRGB green:greenRGB blue:blueRGB alpha:1.0];
You just need to obtain
blueRGB from WebService.
In this You can' face any
I hope It may clears To you.