Re: Why "self"? (Was: Newbie: Referencing Objects)
Re: Why "self"? (Was: Newbie: Referencing Objects)
- Subject: Re: Why "self"? (Was: Newbie: Referencing Objects)
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 27 Oct 2008 20:43:56 -0600
On Oct 27, 2008, at 8:35 PM, john fogg wrote:
Inside "mySubObject" I cannot access this by writing
[pointerToMainObject doMethod];
but it works when I write
[self.pointerToMainObject doMethod];
Why? What difference does "self" make here?
Because the latter accesses the property of self, and the former
doesn't. Assuming you're not developing exclusively for 64-bit (the 64-
bit runtime supports properties without synthesis or implementations,
IIRC), then using the original pointer variable in place of the former
ought to work.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden