Re: Observing changes in Table
Re: Observing changes in Table
- Subject: Re: Observing changes in Table
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 17 Dec 2014 20:10:08 +0700
> On 17 Dec 2014, at 18:32, Jerry Krinock <email@hidden> wrote:
>
>
>> On 2014 Dec 17, at 02:02, 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.
>>
>> 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.
>
> The short answer is that, yes, this is common and the solution is to bind the Content of your array controller to your data model using Cocoa Bindings. I don’t know if your Data Model is the "Array of MutableDictionaries” or the “some data”. We need more detail to give a better answer.
I did:
[ myArrayController addObserver: self
forKeyPath: @"arrangedObjects"
options: 0
context: NULL
];
But editing some value in some row does NOT trigger this.
Works fine when I observe "selectionIndexes" instead.
But I need to know when the content of the arrangedObjects (some value in some MutableDictionary) has changed.
TableView has textDidEndEditing, but this is deprecated.
The delegate has ...shouldEditTableColumn... but I need ...didEdit...
The table is cell-based.
What else to try?
Gerriet.
_______________________________________________
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