Reputation: 7922
I have created #define
statement in project's pch
file so it can be seen in all files in the project, the statement is: #define MYURL(x,y) @"http://internal-sps/providers.aspx?category=(a)®ionID=(y)"
however, I use this macro in any file inside the project like this:
NSString *url = MYURL(@"category1",@"3")
;
then NSLog(@"%@", url);
the console shows this:
http://internal-sps/providers.aspx?category=(a)®ionID=(y)
not the actual values.
how can i get the actual values for this macro ?
Upvotes: 0
Views: 1335
Reputation: 212959
Change:
#define MYURL(x,y) @"http://internal-sps/providers.aspx?category=(a)®ionID=(y)"
to:
#define MYURL(x,y) "http://internal-sps/providers.aspx?category=(a)®ionID=("y")"
and use your macro like this:
NSString *url = @MYURL("category1","3");
Note: if that a
is actually meant to be an x
then it would be:
#define MYURL(x,y) "http://internal-sps/providers.aspx?category=("x")®ionID=("y")"
Upvotes: 3