• 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: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?


  • Subject: Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • From: John Terranova <email@hidden>
  • Date: Thu, 5 Oct 2006 20:31:35 -0700


On Oct 5, 2006, at 9:25 AM, Mailing list subscriptions wrote:

What's the best workaround for this, then?

- avoid NSArrayController, if you *really* need to observe old and new states of the array (arrangedObjects, in my case)


That's what I do. My controller object is a subclass of NSObjectController (though I'm not sure that is even necessary, except for convenient 'content' initialization). The 'content' is set to my main data object, which contains most of my important data. This data object includes a fully KVO-compliant NSMutableArray to hold an important array of objects.

I then manipulate the array directly through the KVO-compliant accessors. Finally, other objects register as observers of the array directly and get full observing information of old and new states.

This also means that my controller objects implements old fashioned data source routines for populating the NSTableView.

I tried some of your other workarounds and just got frustrated, so I decided on this approach of avoiding NSArrayController all together.

	john

Fight war, not wars.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds? (From: Mailing list subscriptions <email@hidden>)

  • Prev by Date: sortDiscriptor binding
  • Next by Date: Re: bindings from threads
  • Previous by thread: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • Next by thread: Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • Index(es):
    • Date
    • Thread