Re: capture #define value?
Re: capture #define value?
- Subject: Re: capture #define value?
- From: Chris Espinosa <email@hidden>
- Date: Sat, 30 Jan 2010 11:53:20 -0800
On Jan 30, 2010, at 10:49 AM, Matt Neuburg wrote: My C skills are missing in action, so this could be a pretty dumb question. But hey, I'm not proud. Or tired.
I'm passing a name-and-value into my code via the build process, thru the preprocessor macros build setting. All well and good; using #ifdef and logging I can tell that the #define of the *name* is working. My question is: can my *code* capture the *value* as an NSString? (And if so, how?) Thx - m.
PS Or feel free to tell me that there's a better way for the build process to send messages to my code.
You have to use token pasting to concatenate the double quotes to the macro expansion.
#define QUOTE "
#ifdef MACROVALUE NSLog("%@", @QUOTE##MACROVALUE##QUOTE);
(Off the top of my head; code not compiled)
Chris |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden