• 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
KVO and master-detail NSTableViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO and master-detail NSTableViews


  • Subject: KVO and master-detail NSTableViews
  • From: Stefan Reitshamer <email@hidden>
  • Date: Thu, 4 Jun 2009 06:24:20 -0400

I'm getting flaky behavior from my KVO code and I'm wondering what I'm doing wrong. I can't find any similar examples.

I have a pop-up button and 2 NSTableViews.
The pop-up button selection controls the content of the left NSTableView. The left NSTableView's selection controls the content of the right NSTableView.


The pop-up button and NSTableViews are bound to separate NSArrayControllers.
Each NSArrayController is bound to a separate NSMutableArray property in my app controller.
My app controller observes "selectionIndex" in the pop-up button's NSArrayController and "selectedObjects" in the left NSArrayController.


On startup, the pop-up button is populated, which causes a call to observeValueForKeyPath:ofObject:change:context:. This sets the left NSMutableArray, which in turn causes another (nested) call to observeValueForKeyPath:ofObject:change:context:, which sets the right NSMutableArray.

There seems to be a race condition -- sometimes the left table view is populated, sometimes the right, sometimes none. Each time I edit the nib, the behavior changes.

Is this a bogus way to implement the dependent NSTableViews?
What's the right way?

Thanks in advance,
- Stefan

_______________________________________________

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: KVO and master-detail NSTableViews
      • From: Ken Thomases <email@hidden>
    • Re: KVO and master-detail NSTableViews
      • From: Keary Suska <email@hidden>
  • Prev by Date: RE: Find default application for file of particular extension
  • Next by Date: Re: QTCaptureSession class reference
  • Previous by thread: RE: Find default application for file of particular extension
  • Next by thread: Re: KVO and master-detail NSTableViews
  • Index(es):
    • Date
    • Thread