EDIT: My example may create some confusion. I modified the example below to reflect what I want to achieve. Hope this is more clear.
I am trying to define a constant in my objective-c code. I use the standard #define for this. For instance:
#define bluh "a"
I would like to define another constant like this
#define blah bluh +@"b"
The compiler throws an error (correctly) "Invalid operands to binary +". How can I make this work? Thanks for the help.
I also tried the objective-c method as follows:
NSString *const A =@"a";
NSString *const B = [NSString stringWithFormat:@"%@%@",A,@"b"];
But this gives me another error: “The initializer element is not permanent” Any help would be appreciated.
Greetings
source
share