Re: Looking at self = [super init].
Re: Looking at self = [super init].
- Subject: Re: Looking at self = [super init].
- From: Quincey Morris <email@hidden>
- Date: Fri, 29 May 2015 17:42:02 +0000
On May 29, 2015, at 10:35 , Jean-Daniel Dupas <email@hidden> wrote:
>
> You must at least returns nil in the fast path, else the compiler will not be happy.
Shame on you, Jean-Daniel, for not spotting the other error!
On May 29, 2015, at 10:22 , Alex Zavatone <email@hidden> wrote:
>
> if (self != [super init]) {
> return;
> }
The opposite of ‘if (self = [super init])’ isn’t ‘if (self != [super init])’. The correct code is:
self = [super init];
if (self == nil)
return nil;
> I'm not smoking crack here, am I?
We only have your word for it.
> Does this actually seem like a good idea?
Of course it’s a good idea (minus the two glaring bugs).
_______________________________________________
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