I'm trying to concatenate two values each defined as macro. At this moment I've:
#define VAL1 @"im/"
#define VAL2 @"test"
#define GLUE_IN(x,y) (x ## y)
#define GLUE(x,y) GLUE_IN(x,y)
[array addObject:GLUE(VAL1, VAL2)];
#define GLUE(x,y) [NSString stringWithFormat:@"%@%@",x,y]
## concatenates tokens, not strings, which causes an invalid resulting token, and in this case is entirely un-necessary since
@"im/" @"test" - being compile time string constants - will be appended anyway. Just do;
#define GLUE_IN(x,y) (x y)
...which will result in
[array addObject:@"im/" @"test"]
...and things should work well.