Re: Why is [nil aMessage] a no-op?
Re: Why is [nil aMessage] a no-op?
- Subject: Re: Why is [nil aMessage] a no-op?
- From: Adam P Jenkins <email@hidden>
- Date: Fri, 18 Apr 2008 09:56:38 -0400
On Apr 18, 2008, at 1:16 AM, Graham Cox wrote:
Here's a simple example:
- (void) dealloc
{
[someIvar release];
[super dealloc];
}
is <someIvar> really initialised? Maybe it's nil? Do I care at this
point? no - either way, the code is correct - if the object was
made, it's released, if it wasn't, it's a no-op. Exactly what you
want.
That makes a lot of sense. I can now picture many lines of code I've
written over the years which wouldn't have been necessary with this
feature.
Thanks a lot to everyone who responded to my question. I now
understand the pros and cons of the nil-eats-messages feature much
better, and it doesn't seem like a mis-feature to me now.
Adam
_______________________________________________
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