• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is [nil aMessage] a no-op?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Why is [nil aMessage] a no-op?
      • From: Rob Napier <email@hidden>
    • Re: Why is [nil aMessage] a no-op?
      • From: Scott Ribe <email@hidden>
References: 
 >Why is [nil aMessage] a no-op? (From: Adam P Jenkins <email@hidden>)
 >Re: Why is [nil aMessage] a no-op? (From: Graham Cox <email@hidden>)
 >Re: Why is [nil aMessage] a no-op? (From: Adam P Jenkins <email@hidden>)
 >Re: Why is [nil aMessage] a no-op? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Different ways of application installation
  • Next by Date: Re: Different ways of application installation
  • Previous by thread: Re: Why is [nil aMessage] a no-op?
  • Next by thread: Re: Why is [nil aMessage] a no-op?
  • Index(es):
    • Date
    • Thread