• 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: meaning of if (self = [super init])
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >meaning of if (self = [super init]) (From: Cyprien <email@hidden>)

  • Prev by Date: some problem in Cocoa - Objective - C
  • Next by Date: Re: meaning of if (self = [super init])
  • Previous by thread: Re: meaning of if (self = [super init])
  • Next by thread: Re: meaning of if (self = [super init])
  • Index(es):
    • Date
    • Thread