• 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: NSArrayController Funkyness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSArrayController Funkyness (From: email@hidden)
 >Re: NSArrayController Funkyness (From: Justin Anderson <email@hidden>)

  • Prev by Date: Tooltips in NSBrowser
  • Next by Date: Re: NSArrayController Funkyness
  • Previous by thread: Re: NSArrayController Funkyness
  • Next by thread: Re: NSArrayController Funkyness
  • Index(es):
    • Date
    • Thread