• 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: Question Regarding the Memory Address of Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question Regarding the Memory Address of Objects


  • Subject: Re: Question Regarding the Memory Address of Objects
  • From: Scott Ribe <email@hidden>
  • Date: Sat, 20 Dec 2008 10:48:41 -0700
  • Thread-topic: Question Regarding the Memory Address of Objects

> An NSMapTable can be configured to give either reasonable behavior
> (strong or zeroing weak reference) so use that instead.

Or, in this special case, simply make sure that the dictionary is only used
while the controller is live--especially easy if the dictionary is a private
field of the controller...

I forget the details of the original message, and whether the code has to
dynamically adapt to different sets of outlets. If not, then consider:

enum { kButton1 = 0, kButton2, kText1, ..., kNumOfControls};

id controls[kNumOfControls];

controls[kButton1] = button1;
...

For (int i = 0; i < kNumOfControls; ++i)
  [controls[i] doSomething: ...];


--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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: Question Regarding the Memory Address of Objects (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Optimizing NSRectFill
  • Next by Date: selectionShouldChangeInTableView called twice
  • Previous by thread: Re: Question Regarding the Memory Address of Objects
  • Next by thread: Debugging a Plugin
  • Index(es):
    • Date
    • Thread