Re: [Obj-C] if (self) vs. if (self != nil)
Re: [Obj-C] if (self) vs. if (self != nil)
- Subject: Re: [Obj-C] if (self) vs. if (self != nil)
- From: Scott Ribe <email@hidden>
- Date: Sat, 25 Feb 2012 07:29:32 -0700
On Feb 25, 2012, at 2:29 AM, David Mirabito wrote:
> Not terribly helpful since the cocoa headers are what they are, but in other codebases I sneak around issue this by setting up the defines:
>
> #define FALSE 0
> #define TRUE (!FALSE)
>
> Then something like "if (mybool == TRUE)" acts as expected across all non-zero values.
(!0) evaluates to 1.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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