Re: Observing changes in Table
Re: Observing changes in Table
- Subject: Re: Observing changes in Table
- From: Keary Suska <email@hidden>
- Date: Wed, 17 Dec 2014 08:23:06 -0700
On Dec 17, 2014, at 3:02 AM, Gerriet M. Denkmann <email@hidden> wrote:
> A TableView with an ArrayController which has an Array of MutableDictionaries; keys corresponding to TableColumns.
> The table is editable and the dictionary of the edited row gets changed.
>
> All as expected.
>
> But I want to know when any value of any row has been changed by the user, in order to update some data.
> This looks like a very common problem. So probably it has a very simple solution.
>
> But how?
By not using NSMutableDictionary ;-) Generally when one is needs an object with a well-defined form, using a specifically defined object (vs NSDictionary) tends to be more appropriate. It will be faster, use less memory, and be more extensible.
Further, you might run into problems if you need to know exactly which object/key was edited in -textDidEndEditing:. I recall having some issue with this a while ago, but I don't recall. If you get correct values from -editedRow and -editedColumn, and can then map column indexes to keys, you might be fine.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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