I’m doing something slightly or monumentally wrong.
I want to swap a UIColour for a programmable variable, for example:
NSString *DataColourTitle = @"greenColor";
[[UINavigationBar appearance] setTintColor: [UIColor [NSString stringWithFormat: @"%@", DataColourTitle]]];
I’m getting an Expected Identifier error at the NSString part and haven’t worked out the formatting required to accomplish this.
The syntax for calling a class method of UIColor would be
[UIColor <#some selector#>]where <#some selector#> is an identifier such asgreenColor, not a string. The selector that it expects is a reference to code that can return a UIColor object, whereas@"greenColor"is just a static, literal string of bytes wrapped up as a NSString object.Try something like: