I’m trying to create an Objective-C string using the ‘#’ and ‘##’ operators. I’ve written the following macros:
#define OBJCKEY(p, s) p ## s
#define KEY(k) OBJCKEY(@, #k)
Which I’m trying to use in a function in the following way:
NSString *key = KEY(EnumValue1);
But Xcode reports the following error:
Pasting formed '@"EnumValue1"', an invalid preprocessing token
Any idea on how to fix this?
Note: I’m using the LLVM compiler.
Is there anything wrong with
Or how about