Friday, December 13, 2013

Objective c how to define macros

How in Objective c is defined as the following macro code:
# Ifdef _DEBUG
NSLog (@ "Error");
# Endif
Reply:
Nobody knows? This score how do I?
Reply:
cited a floor sqzxcv reply:
Nobody knows? This score how do I?

Not used, huh over a period of time to learn OC, only Bangding.
Reply:
The reply was deleted at the moderator 2010-04-22 13:21:39

Reply:
cited landlord sqzxcv reply:
how the following code in Objective c is defined as a macro:
# Ifdef _DEBUG
NSLog (@ "Error");
# Endif


Accordance with the standard C syntax is no problem
Reply:
iPhone is deserted, said plate
Reply:
You then write it on the line ah?
That you are not already a pre-compiled it?
Zayang want?

Perhaps think so?
 
# Ifdef _DEBUG
# Define TRACE (...) NSLog (__VA_ARGS__)
# Else
# Define TRACE (...) (void) 0
# Endif

In this way, you just call later on TRACE on the line, do not write in every place three sentences, Ha ha ha.
Reply:
According to the standard C syntax rules is possible!
Reply:
Like you are OK, ah, what the problem
Reply:
Is the same as with C, OBJECTIVE-C is an extension c
Reply:
references, 5th Floor defonds reply:
iPhone plate is deserted, said


Oh yes ah, too deserted
Reply:
If you are referring to how the development environment set Predefinition then please refer to this
http://blog.csdn.net/cloudhsu/archive/2010 / 07/26/5766100.aspx

Reply:
You are right.
Reply:
The reply was deleted at the moderator 2010-09-02 11:23:09

Reply:
You are right.
Reply:
Right way to go. .
Reply:
Like standard C
Reply:
This is not what your landlord pre-compiled is ah? Halo. . . .
Reply:
The reply was deleted at the moderator 2011-04-11 08:35:56

Reply:
cited landlord sqzxcv reply:
how the following code in Objective c is defined as a macro:
# Ifdef _DEBUG
NSLog (@ "Error");
# Endif


Macro code is replaced with ObjC okay.
If you want to customize a name, for example: # ifdef XXXXXX, defined in the project settings in a can.
Reply:
Can be used define SOME
#
It does not seem to support conditional compilation.
Reply:
cited 20 floor ilysony reply:
can use # define SOME

It does not seem to support conditional compilation.


Support.
Reply:
Look a little Mongolian, NSlog not that used in xcode in it?
Reply:
cited 22 floor dxchenqing reply:
look a little Mongolian, NSlog not that used in xcode in it?


The same question is a printf do not ......
Reply:
Macro which can not contain non-string symbol #
againThis situation can not be achieved landlord

No comments:

Post a Comment