Re: NSArrayController and NStableView Binding
Re: NSArrayController and NStableView Binding
- Subject: Re: NSArrayController and NStableView Binding
- From: Ken Thomases <email@hidden>
- Date: Sat, 2 Aug 2008 23:26:21 -0500
On Aug 1, 2008, at 6:53 PM, Revant Jain wrote:
Now my Question was that when I double click on a cell in
NSTableView to
edit it what method does it call in the MyDocument class(if any) to
reflect
the edit onto the particular Person object?
If it does not call a method in MyDocument class how does it change
the
instance variables of the particular Person object being edited?
Does each
cell of the NSTableView have reference to its respective Person
Object and
it just uses an accessor?
The exact sequence is an implementation detail. Roughly, it invokes
something like
[theArrayController setValue:theNewValue
forKeyPath:@"selection.personName"] (or .expectedRaise)
The array controller turns that into a call like
[[theMyDocumentInstance
objectInEmployeesAtIndex:indexOfSelectedObject] setValue:theNewValue
forKeyPath:@"personName"]
From there, KVC does it's usual job, which is typically to invoke the
setter (setPersonName:) on your Person object, if that accessor is
available.
Cheers,
Ken
_______________________________________________
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