Richard Frith-Macdonald wrote:
On 29 Jan 2004, at 12:24, Manuel Guesdon wrote:
So as far as I understand [NSNumber numberWIthBool:2] will return
boolN which is wrong as 2 is TRUE, isn't it ? (Or may
I need some sleep ? :-)
I agree it'll return boolN ... but 2 is not YES
Booleans in objc can be YES or NO ... this is not the same thing as
true/false in C/ObjC conditionals where 0 is false and anything
non-zero is true.
Checking the online docs:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSNumber.html#//apple_ref/doc/initWithBool_
I read:
boolValue:
...
*Note: *The value returned by this method isn’t guaranteed to be one
of |YES| or |NO|. A 0 value always means |NO| or false, but any
nonzero value should be interpreted as |YES| or true.