• 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: NSArrayController and NStableView Binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSArrayController and NStableView Binding (From: "Revant Jain" <email@hidden>)

  • Prev by Date: Re: Some crash.
  • Next by Date: Re: Coding around a known bug - SOLVED (acceptably)
  • Previous by thread: NSArrayController and NStableView Binding
  • Next by thread: 2 outline views, selection changes
  • Index(es):
    • Date
    • Thread