I read a NSString from file and then I want to #define this as a UIColor so I can quickly change color's.
I want something to work like so:
#define GRAY [UIColor darkGrayColor]
Then read from file the string : @"GRAY" and put it in a NSString variable called kColor
And then paste this onto a backgroundcolor property like so:
myController.view.backgroundColor = kColor;
now this means I get :
myController.view.backgroundColor = @"GRAY";
I need:
myController.view.backgroundColor = GRAY;
for the #define to work. So how do i remove @"" from the string or typecast the string into a variable name? I'm not stuck on #define so if there is another way to get this to work, I'm open to that.
Help is greatly appreciated.