Re: == nil vs. isEqual:nil
Re: == nil vs. isEqual:nil
- Subject: Re: == nil vs. isEqual:nil
- From: Andreas Monitzer <email@hidden>
- Date: Wed, 15 Aug 2001 22:56:53 +0200
On Wednesday, August 15, 2001, at 10:22 , Mike Beam wrote:
Hello!
When I'm checking to see whether a suppposed object is nil, is it best to
use
anObject == nil
Or
[anObject isEqual:nil];
Or none of the above? Is this a nit-picky point? Does it matter at all?
You can use whatever you want (the second one is more expensive when
anObject is non-nil). I usually do it this way:
if(!anObject) {
}
which means "if anObject does not exist"
andy
--
Description forthcoming.