Re: Editing a TableView
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