• 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: Observing changes in Table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Observing changes in Table
      • From: Ken Thomases <email@hidden>
References: 
 >Observing changes in Table (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Observing changes in Table (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Replace -lockFocus with Block-Based Drawing Method (was NSCustomImageRep…)
  • Next by Date: How to make a TableColumn unsortable
  • Previous by thread: Re: Observing changes in Table
  • Next by thread: Re: Observing changes in Table
  • Index(es):
    • Date
    • Thread