I want a macro that I can use like this:
CREATE_URL(@"{SOME-TOKEN}/some/url/path");
The macro should then replace my token analogue to the following call:
NSString *initialURL = @"{SOME-TOKEN}/some/url/path";
[initialURL stringByReplacingOccurencesOfString:@"{SOME-TOKEN}" withString:@"http://server.com"]
So I have defined my macro like this, which does not work unfortunately:
#define CREATE_URL(url) [##url stringByReplacingOccurencesOfString:@"{SOME-TOKEN}" withString:@"http://server.com"];
I the two errors when using the macro:
Missing '[' at start of message send expression
Pasting formed '[@', an invalid preprocessing token
Why not this?
It should work fine… why the ## and the ;?