Re: Method not seeing array as array
Re: Method not seeing array as array
- Subject: Re: Method not seeing array as array
- From: Clark Cox <email@hidden>
- Date: Thu, 3 Feb 2005 08:44:14 -0500
On Thu, 3 Feb 2005 03:06:53 -0800 (PST), Will Mason
<email@hidden> wrote:
> > >> 'if(!self) return nil' line)
> > >
> > > Is there something wrong with
> > >> if(!self) return nil;
> > > other than its being a shorthand for
> > >> if(self == nil) return nil;
> > > ?
> >
> > In reality no... it more clearly conveys your intent to test against
> > nil since nil explicitly implies no object.
>
> The problem with "if (!self)" is that you're assuming that nil is equal
> to zero. I have never seen documentation that says that nil has to be
> zero.
You're guaranteed by the C and C++ standards that a NULL pointer will
compare equal to zero. It's safe to use that on any C or C++ compiler.
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden