Re: meaning of if (self = [super init])
Re: meaning of if (self = [super init])
- Subject: Re: meaning of if (self = [super init])
- From: Tito Ciuro <email@hidden>
- Date: Wed, 25 Jun 2003 07:44:32 -0700
On Wednesday, June 25, 2003, at 7:10 AM, Cyprien wrote:
What's the meaning of this code line ?
if (self = [super init])
It's equivalent to:
self = [super init];
if (self) {
// Do something here
}
does self return a Boolean, whatever the receiver is ?
and I suppose that this has nothing to do with
if (self == [super init])
Upon successful init, self will point to the object, otherwise it'll be
nil. In this case, 'if' will evaluate to true if self is non-nil, false
otherwise.
-- Tito
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.