• 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: Maintaining a List of instances of a class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maintaining a List of instances of a class


  • Subject: Re: Maintaining a List of instances of a class
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 18 Jul 2007 09:36:41 -0400

On 7/18/07, Stefan Heukamp <email@hidden> wrote:
how do I let a class maintain a list (MutableArray) of it's own
instances? In C++ I would do this just in the constructor.
In Objective-C / Cocoa, I have this +(id) alloc function. But I don't
know how to get the pointer to the instance here.

The short (but accurate) answer is: put them in an array as you create them.

 A better question: What are you really trying to do, in general
terms? In all likelihood, there is a much better approach than the one
you assume you need. Basically, if you really needed the functionality
as you described it above, you'd probably already know how to
implement it, IMHO.

--
I.S.
_______________________________________________

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: 
 >Maintaining a List of instances of a class (From: Stefan Heukamp <email@hidden>)

  • Prev by Date: Re: NSProgressIndicator (CallBacks)
  • Next by Date: Re: Maintaining a List of instances of a class
  • Previous by thread: Maintaining a List of instances of a class
  • Next by thread: Re: Maintaining a List of instances of a class
  • Index(es):
    • Date
    • Thread