• 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: Editing a TableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing a TableView


  • Subject: Re: Editing a TableView
  • From: Scott Anguish <email@hidden>
  • Date: Sat, 16 Oct 2010 04:28:06 -0400

On Oct 16, 2010, at 4:00 AM, Gerriet M. Denkmann wrote:

> The documentation for "allKeys" states: "The order of the elements in the array is not defined."
> Does this mean that subsequent method invocations to "allKeys" might get different arrays - even if the dictionary has not changed?

Yes.. You can’t depend on the ordering. Plain and simple.

This is easy enough to get around by simply keeping the dictionaries in your own array and using that as the ordering rather than allKeys or allValues. This is how I do it, and the only way I’d suggest to do it.

Or, even better in most cases, use a real class of your own rather than a dictionary.

Even using your own class you can take advantage of KVC to access your data in a general manner. Use the identifier of the table column, set it to the field name, fetch and return the value using valueForKey: and the identifier string. You can use the same strategy in reverse when editing.


_______________________________________________

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: 
 >Editing a TableView (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Editing a TableView
  • Next by Date: Re: What is the expected Cocoa API behavior in an incomplete object traversal?
  • Previous by thread: Editing a TableView
  • Next by thread: running a timer while displaying a sheet
  • Index(es):
    • Date
    • Thread