ObjC BOOL and boolean c expressions
ObjC BOOL and boolean c expressions
- Subject: ObjC BOOL and boolean c expressions
- From: Eyal Redler <email@hidden>
- Date: Fri, 31 Aug 2007 08:30:31 +0300
Hi,
I'm not sure where and when but I recall reading something about ObjC
BOOL type values YES and NO not being the same as whet a boolean
expression might produce.
I can't recall the exact details but there was some kind of gotcha
related to this. For example, the expression
BOOL myBool=(myInt==1);
might set myBool differently then
BOOL myBool=(myInt==1)?YES:NO;
Or maybe it was that
if (myBool)
[foo bar];
will perform differently then
if (myBool==YES)
[foo bar];
Or maybe it was just that if I do this
int myInt=4096;
BOOL myBool=myInt;
Then if (myBool) will evaluate to false.
This issue was bugging me for quite some time and I'm wondering if
somebody recalls this discussion.
TIA
Eyal Redler
======================================
RedleX - Makers of Mellel
www.mellel.com
email@hidden
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden