• 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: Restoring sort order to NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restoring sort order to NSTableView


  • Subject: Re: Restoring sort order to NSTableView
  • From: Trygve Inda <email@hidden>
  • Date: Tue, 20 Nov 2007 13:13:57 +0000
  • Thread-topic: Restoring sort order to NSTableView

Ok,

It works with:

NSData *sortOrderDesc = [NSArchiver archivedDataWithRootObject:[myTableView
sortDescriptors]];

[prefs setObject:sortOrderDesc forKey:@"sortOrderDesc"];

Why do I have to do it this way if NSSortDescriptor conforms to NSCoding?

Trygve


> On 11/20/07 12:01 AM, "Keary Suska" <email@hidden> wrote:
>
>> on 11/18/07 7:39 AM, email@hidden purportedly said:
>>
>>> I have an NSArrayController hooked to an array (of NSDictionary) and bound
>>> to columns in a NSTableView. It all works fine. I added an auto save name to
>>> the table so that the column widths and ordering are restored upon launch,
>>> but can't get it to restore the sort order.
>>
>> You could bind the sort descriptors to an NSUserDefaultsController, which is
>> probably what you are after.
>
> Nope, that causes a crash on launch.
>
> I also get a crash when trying to do it this way:
>
> NSArray      *descriptors = [myTableView sortDescriptors];
> CFPreferencesSetAppValue (CFSTR("SortOrder"), descriptors, appID);
>
> The Array is ok:
>
> <CFArray 0x3c3ea0 [0xa080c1c0]>{type = immutable, count = 1, values = (
>     0 : (name, ascending, caseInsensitiveCompare:)
>
> Crash in CFRetain.
>
> Any ideas?
>
>
> _______________________________________________
>
> 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
>


_______________________________________________

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: Restoring sort order to NSTableView
      • From: mmalc crawford <email@hidden>
References: 
 >Re: Restoring sort order to NSTableView (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Custom binding not being updated
  • Next by Date: Re: Xcode 3, problem creating Core Data UI via drag and drop
  • Previous by thread: Re: Restoring sort order to NSTableView
  • Next by thread: Re: Restoring sort order to NSTableView
  • Index(es):
    • Date
    • Thread