Skip navigation.
 
mlRe: Why is [nil aMessage] a no-op?
FROM : Adam P Jenkins
DATE : Fri Apr 18 15:56:38 2008

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

Related mailsAuthorDate
mlWhy is [nil aMessage] a no-op? Adam P Jenkins Apr 18, 00:42
mlRe: Why is [nil aMessage] a no-op? Nick Zitzmann Apr 18, 01:00
mlRe: Why is [nil aMessage] a no-op? Bill Bumgarner Apr 18, 01:07
mlRe: Why is [nil aMessage] a no-op? Jeff Apr 18, 02:46
mlRe: Why is [nil aMessage] a no-op? Graham Cox Apr 18, 03:19
mlRe: Why is [nil aMessage] a no-op? David Wilson Apr 18, 03:51
mlRe: Why is [nil aMessage] a no-op? Michael Ash Apr 18, 04:13
mlRe: Why is [nil aMessage] a no-op? Adam P Jenkins Apr 18, 06:20
mlRe: Why is [nil aMessage] a no-op? Bill Bumgarner Apr 18, 06:47
mlRe: Why is [nil aMessage] a no-op? Adam P Jenkins Apr 18, 06:56
mlRe: Why is [nil aMessage] a no-op? Adam P Jenkins Apr 18, 07:01
mlRe: Why is [nil aMessage] a no-op? Graham Cox Apr 18, 07:16
mlRe: Why is [nil aMessage] a no-op? Michael Vannorsdel Apr 18, 07:21
mlRe: Why is [nil aMessage] a no-op? Bill Bumgarner Apr 18, 07:46
mlRe: Why is [nil aMessage] a no-op? Sherm Pendley Apr 18, 07:52
mlRe: Why is [nil aMessage] a no-op? Jens Alfke Apr 18, 08:13
mlRe: Why is [nil aMessage] a no-op? Gerriet M. Denkman… Apr 18, 10:32
mlRe: Why is [nil aMessage] a no-op? ab_lists Apr 18, 10:56
mlRe: Why is [nil aMessage] a no-op? Citizen Apr 18, 15:22
mlRe: Why is [nil aMessage] a no-op? Adam P Jenkins Apr 18, 15:56
mlRe: Why is [nil aMessage] a no-op? Scott Ribe Apr 18, 16:49
mlRe: Why is [nil aMessage] a no-op? Andy Lee Apr 18, 17:18
mlRe: Why is [nil aMessage] a no-op? Rob Napier Apr 18, 18:19