• 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: trouble keeping NSTableView sorted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trouble keeping NSTableView sorted


  • Subject: Re: trouble keeping NSTableView sorted
  • From: Keary Suska <email@hidden>
  • Date: Fri, 07 Dec 2007 12:40:03 -0700
  • Thread-topic: trouble keeping NSTableView sorted

on 12/7/07 7:48 AM, email@hidden purportedly said:

> Hello,
>
> To keep a NSTableView contents sorted I believe I need to bind the
> table's sortDescriptors to the array controller the table is bound
> to.

Depends on what you mean by "keeping sorted", although your approach is
incorrect for just about any interpretation.

If you mean that you want a set sort order that the user can't change, then
bind the tablevew's selectionIndexes to the array controller. This will
disable column header sorting.

Sort descriptors are implicitly bound, so you don't have to be concerned
about them. Just make sure the array controller has the correct sort
descriptors already set.

>      Bind to: MyController
>      Controller Key: arrangedObjects
>      Model Key Path: name
>
> "name" is the key to the NSString value of the objects MyController
> handles.

If the above isn't simply a random stab in the dark, you really need to
re-read the bindings documentation and examples, as well as the docs on
NSSortDescriptor. The above seems to show that you aren't clear on either.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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: 
 >trouble keeping NSTableView sorted (From: Gonzalo Castro <email@hidden>)

  • Prev by Date: Re: Best way to bind an Inspector to iVars/Properties?
  • Next by Date: Re: trouble keeping NSTableView sorted
  • Previous by thread: trouble keeping NSTableView sorted
  • Next by thread: Re: trouble keeping NSTableView sorted
  • Index(es):
    • Date
    • Thread