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