Re: Why "self"? (Was: Newbie: Referencing Objects)
Re: Why "self"? (Was: Newbie: Referencing Objects)
- Subject: Re: Why "self"? (Was: Newbie: Referencing Objects)
- From: "john fogg" <email@hidden>
- Date: Tue, 28 Oct 2008 03:35:55 +0100
Hi again!
I'm still plucking along and any help is still greatly appreciated!
Here is the deal: I create a subobject called "mySubObject" inside my
main object "myMainObject". Now I want to access "myMainObject" from
within "mySubObject".
I'm still not sure what the ideal way to do this would be but I have
gotten it to work somehow. Inside "myMainObject" I create a property
and point it to "self" so it stores a reference to "myMainObject".
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?
I'm still trying to wrap my head around all this stuff so please bear
with me here. :-)
_______________________________________________
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