• 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: class variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class variables


  • Subject: Re: class variables
  • From: Keith Duncan <email@hidden>
  • Date: Tue, 20 Feb 2007 22:05:16 +0000

If you only need the array in one method then you can put the static definition inside your sorting method and alloc it in there if it is nil. That way you can avoid polluting the global namespace. Otherwise a class method would be best.

- Keith


On 19 Feb 2007, at 14:08, Jim Thomason wrote:

I've got a list of useful data I need to use stored in an NSArray.
Just a list of strings (class names) in a particular order, which I
need to use for sorting purposes. I originally just had my sort method
constantly re-allocate and subsequently destroy this array
every...single...time. Not the right way to do it, but it's
conceptually easy. Now it's time to clean it up.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >class variables (From: "Jim Thomason" <email@hidden>)

  • Prev by Date: Re: When does -[NSWindow sendEvent:] beep?
  • Next by Date: Re: File's Owner, NSWindowController, KVO, bindings
  • Previous by thread: Re: class variables
  • Next by thread: Re: class variables
  • Index(es):
    • Date
    • Thread