Re: Persistence of Sort Orderings in NSTableView using Bindings
Re: Persistence of Sort Orderings in NSTableView using Bindings
- Subject: Re: Persistence of Sort Orderings in NSTableView using Bindings
- From: Dave Teare <email@hidden>
- Date: Tue, 12 Dec 2006 17:25:31 -0500
AFAIK the your table order won't be automatically restored. You need
to call rearrangeObjects on your controller.
Also, note that on tables you need to set the autosaveName and
setAutosaveTableColumns if you want the table column order/size
remembered.
HTH.
--Dave.
On 12-Dec-06, at 2:19 PM, Ryan Poling wrote:
I have a very simple desire I would like fulfilled. ;-) I'd like my
NSTableView which is hooked up to an NSArrayController via Cocoa
Bindings to remember **and** restore its sort orderings at each
launch.
Currently, the sort orderings are dutifully saved in my user
defaults as
"NSTableView Sort Ordering myTable" but they are never restored.
I've googled this a bit - found one other person with the same
problem,
but nobody replied to his email about it.
I currently have each NSTableColumn bound to the NSArrayController's
value and color attributes, and from what I've read, it looks like the
NSTableView's content, selectionIndexes and sortDescriptors should be
automatically bound when I bind the columns. Just in case, I tried
binding them manually with no luck (and have taken those bindings off
again now).
From the Cocoa documentation on NSTableView:
"Discussion
A table column is considered sortable if it has a sort descriptor that
specifies the sorting direction, a key to sort by, and a selector
defining how to sort. The array of sort descriptors is archived. Sort
descriptors persist along with other column information if an autosave
name is set."
I have my autosave name set... I guess the docs just say that the info
persists, not necessarily that it restores, but everything else about
the table restores itself from the user defaults.
Any ideas?
Thanks,
-Ryan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40tearesolutions.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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