• 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: kvc/kvo for arrays defeated me.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kvc/kvo for arrays defeated me.


  • Subject: Re: kvc/kvo for arrays defeated me.
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 13 Mar 2009 22:57:33 -0400

On Fri, Mar 13, 2009 at 10:04 PM, Darren Minifie <email@hidden> wrote:
> Kyle what do you mean by binding
> the table view's content property?  I understand what you mean, but I'm
> unsure of what I should bind it to.  The array controller's array?  or the
> tableView's dataSource?

Well I assume you're not using a data source since you're using bindings.

The column bindings are, strictly speaking, used only to provide
content for the column's cell when drawing the rows of the table.  The
table itself, not its columns, manages its selection, so in order to
coordinate this selection with the controller its own selection
bindings need to be bound to the controller supplying its data.
Binding the table's content binding will take care of these bindings
automatically.  If it can figure it out, the table view will also
deduce the object and keypath to use for its content binding from the
columns' value bindings.

So you would normally have something like this:
column1.value -> [myController].arrangedObjects.title
column2.value -> [myController].arrangedObjects.artist

Then the framework will automatically fill in the following bindings:
tableView.content -> [myController].arrangedObjects
tableView.selectionIndexes -> [myController].selectionIndexes
tableView.sortDescriptors -> [myController].sortDescriptors

You can manually specify these three bindings, which is particularly
useful if you need the selection in the table view to be bound to an
array controller completely different from the one(s) providing data
for your column(s).

Also, I see that the NSTableView bindings document has been updated
with more information on to automagic bindings:
http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSTableView.html

Thank you to whoever took care of that one.

--Kyle Sluder
_______________________________________________

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: Re: kvc/kvo for arrays defeated me.
      • From: email@hidden
References: 
 >kvc/kvo for arrays defeated me. (From: Darren Minifie <email@hidden>)
 >Re: kvc/kvo for arrays defeated me. (From: Quincey Morris <email@hidden>)
 >Re: kvc/kvo for arrays defeated me. (From: Kyle Sluder <email@hidden>)
 >Re: kvc/kvo for arrays defeated me. (From: Quincey Morris <email@hidden>)
 >Re: kvc/kvo for arrays defeated me. (From: Kyle Sluder <email@hidden>)
 >Re: kvc/kvo for arrays defeated me. (From: Darren Minifie <email@hidden>)

  • Prev by Date: Calling Script Objects in Applescript
  • Next by Date: Re: Performance problem with GC enabled
  • Previous by thread: Re: kvc/kvo for arrays defeated me.
  • Next by thread: Re: Re: kvc/kvo for arrays defeated me.
  • Index(es):
    • Date
    • Thread