• 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: Why "self"? (Was: Newbie: Referencing Objects)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Why "self"? (Was: Newbie: Referencing Objects) (From: "john fogg" <email@hidden>)

  • Prev by Date: Re: Why "self"? (Was: Newbie: Referencing Objects)
  • Next by Date: Re: Why "self"? (Was: Newbie: Referencing Objects)
  • Previous by thread: Re: Why "self"? (Was: Newbie: Referencing Objects)
  • Next by thread: Re: Why "self"? (Was: Newbie: Referencing Objects)
  • Index(es):
    • Date
    • Thread