Re: self
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>) |