• 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: self
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: self


  • Subject: Re: self
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 8 Jun 2005 17:38:23 +0200

Theodore,

On 8.6.2005, at 16:59, Theodore H. Smith wrote:

Am I right in thinking that self is a local

Completely.

(stack based) variable?

Depends on how the compiler feels at the moment :) -- it might keep it in the register it comes in (for it actually is the first argument, $r3).


At least, for today, whilst we still run on a decent architecture...

for example the code:

-(id) init {
    self = [self initSpecial];
    return self;
}
should alter everything in exactly the same way as:
-(id) init {
    return [self initSpecial];
}

Exactly. Note also that the former is *needed* in case of more complex initialization:


-init {
self=[self initSpecial]; // also may need to check for nil depending on the following code
[self whatever];
return self;
}
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >self (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: self
  • Next by Date: Re: self
  • Previous by thread: Re: self
  • Next by thread: - (IBAction)showWindow:(id)sender
  • Index(es):
    • Date
    • Thread