Tuesday, December 24, 2013

objective-c of the BOOL and bool What is the difference

I'm just a novice obj-c, see obj-c, there are two definitions of boolean type BOOL and bool, do not know what is the difference between the two, please expert advice.

Reply:
BOOL two values ​​is YES and NO, bool is true and false. . .
Reply:
cited a floor gssnail reply:
BOOL two values ​​is YES and NO, bool is true and false. . .


oh, thank you very much
Reply:
cited a floor gssnail reply:
BOOL two values ​​is YES and NO, bool is true and false. . .


There is a problem, we usually bool it should be more or native obj-c of BOOL use?
Reply:
These two types are differentiated:

Value BOOL only take the highest position to make a judgment, for example, two 229 5 is 0x101, for BOOL is YES, 4 2-band is 0x100, for BOOL is NO

But do not comply with this rule seems pointer

bool value, and direct access to zero and non-zero.
Reply:
BOOL is Apple's own seal it!
Reply:
Ultimately, a macro
Reply:
Look at their definitions, sdk write very clearly.
Reply:
No difference, with the assured, but obj-c accustomed to the YES and NO and BOOL

No comments:

Post a Comment