• 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: Clark Cox <email@hidden>
  • Date: Wed, 8 Jun 2005 11:13:11 -0400

On 6/8/05, Theodore H. Smith <email@hidden> wrote:
>
> Am I right in thinking that self is a local (stack based) variable?


Yes and no. Self is actually a hidden function parameter. For
instance, the method:

-(id)foo
{
}

Is really, under the hood, a function that looks something like:

id foo(id self, SEL _cmd)
{

}

> 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];
> }

Yes.

--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
 _______________________________________________
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

  • Follow-Ups:
    • Re: self
      • From: Mark Lively <email@hidden>
    • Re: self
      • From: "Theodore H. Smith" <email@hidden>
References: 
 >self (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: universal binary compilation errors
  • Next by Date: Re: Sorted arrays
  • Previous by thread: self
  • Next by thread: Re: self
  • Index(es):
    • Date
    • Thread