Re: NSArrayController Funkyness
Re: NSArrayController Funkyness
- Subject: Re: NSArrayController Funkyness
- From: email@hidden
- Date: Fri, 16 Jan 2004 13:00:32 -0500
The last line is the correct situation. I need to maintain the original
order. In fact, I have menu that allows the user to select ordered or
unordered, so I need a subclass for this.
For some reason, the table thinks there is one more object than there
should be only when an object is removed using the sorted list.
Something is not being updated.
On 16 Jan 2004, at 10:38 AM, Justin Anderson wrote:
It sounds like you're doing more work than you need to. For the
functionality you're asking for, you don't need to subclass anything.
As long as the ordering of your NSArray is based on the key "name",
then why not just let the NSArrayController do the sorting work for
you? Bind your NSTableColumn's value to the NSArrayController's
arrangedObjects with a model key path of "name", and make two buttons
in IB that call add: and remove: respectively on the
NSArrayController. That does everything you've mentioned without a
line of code. (Unless, that is, you also wanted to maintain the option
of returning to the original unsorted state.)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.