• 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: Pontus Ilbring <email@hidden>
  • Date: Wed, 8 Jun 2005 17:28:25 +0200

On 6/8/05, Theodore H. Smith <email@hidden> wrote:
>
> Am I right in thinking that self is a local (stack based) variable?
>
> 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];
> }

The short answer is Yes, kind of.

self is the hidden first parameter to the method and will be stored in
a register on PPC. As with any parameter or other local variable
assigning to it will have no effect outside the scope of the method
and the two pieces of code are therefore equivalent.
 _______________________________________________
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: - (IBAction)showWindow:(id)sender
  • Next by Date: Re: self
  • Previous by thread: Re: self
  • Next by thread: Re: self
  • Index(es):
    • Date
    • Thread