• 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
Has anyone put together an order-preserving NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Has anyone put together an order-preserving NSDictionary


  • Subject: Has anyone put together an order-preserving NSDictionary
  • From: Scott Ellsworth <email@hidden>
  • Date: Thu, 14 Apr 2005 12:36:50 -0700

Hi, all.

I have an NSDictionary as one of my primary datastores. I want to throw its contents into an NSTableView via the NSArrayController running the table.

Currently, I do this the ugly way: take the dictionary, grab the key array, copy it, then use that read-only stable copy to rummage through. (Done because the ordering can potentially change on you.)

I would much rather have something with both NSDictionary and NSArray accessors that exposes the underlying key array in a stable order, so add and delete work correctly and are reflected in the underlying data. This would involve a subclass that composes an NSMutableDictionary and NSMutableArray, and which then overrides appropriate methods and passes them through to the underlying data stores.

Not terribly difficult conceptually, but enough of a pain to do right that I do not relish it. Anyone already done this and put it Out There?

Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Using NSArrayController with non-array datastructures
  • Next by Date: Re: Sound Input Meter (Or, getting amplitude of input stream)
  • Previous by thread: Re: Sound Input Meter (Or, getting amplitude of input stream)
  • Next by thread: Re: Is the Jaguar user base large enough to still
  • Index(es):
    • Date
    • Thread