• 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: Newbie: Referencing Objects (second try)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: Referencing Objects (second try)


  • Subject: Re: Newbie: Referencing Objects (second try)
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 26 Oct 2008 15:40:58 -0600


On Oct 26, 2008, at 2:59 PM, john fogg wrote:

When I'm inside "secondSubObject" how can I alter a variable in
"secondMainObject"?

Use accessors. In secondSubObject, create an @property(assign) SecondMainObject *secondMainObject; so that you can call methods in secondMainObjct from secondSubObject.


Note that it's important that you assign instead of retain in this instance, or else you'll create a retention loop memory leak unless you're using GC.

And how can I alter a variable in "firstMainObject"?


Again, use accessors so that objects can communicate with other objects.

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


  • Follow-Ups:
    • Re: Newbie: Referencing Objects (second try)
      • From: "john fogg" <email@hidden>
References: 
 >Re: Newbie: Referencing Objects (second try) (From: "john fogg" <email@hidden>)

  • Prev by Date: Re: CFPreferences and init.
  • Next by Date: Re: CFPreferences and init.
  • Previous by thread: Re: Newbie: Referencing Objects (second try)
  • Next by thread: Re: Newbie: Referencing Objects (second try)
  • Index(es):
    • Date
    • Thread