• 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
NSViewController's representedObject and NSArrayController's selection don't mix?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSViewController's representedObject and NSArrayController's selection don't mix?


  • Subject: NSViewController's representedObject and NSArrayController's selection don't mix?
  • From: Jacob Lukas <email@hidden>
  • Date: Sun, 6 Apr 2008 22:52:04 -0400

I have a table of Core Data objects and a set of inspector views. Depending on the Class(es) of the selection in the table view, the set of inspector views changes.

I managed the inspector views with NSViewControllers. The fields in the inspector view are bound to the view controller's representedObject -- ex. representedObject.radius. This works, but when I add a deeper path to the mix (ex. representedObject.material.refractionIndex), I get the following message in the console when the selection changes:

2008-04-06 22:35:40.095 RayT[14429:10b] Cannot remove an observer <NSKeyValueObservance 0x11434b1c0> for the key path "material.refractionIndex" from <_NSControllerObjectProxy 0x114329b30>, most likely because the value for the key "material" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the _NSControllerObjectProxy class.

The first selection works, but each selection change after that trigger this message.

Since the applicable inspector views change, I set their representedObject just before adding them to the screen:

[controllers makeObjectsPerformSelector:@selector(setRepresentedObject:) withObject: [configController selection]];

Where controllers is the list of inspector views and configController is the array controller. If I precede this by first setting the representedObject to nil, I get the message every other selection event, rather than every event.

Can anyone help shed some light on this situation?

Thank you,
Jacob Lukas
_______________________________________________

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:
    • [SOLVED] Re: NSViewController's representedObject and NSArrayController's selection don't mix?
      • From: Jacob Lukas <email@hidden>
    • Re: NSViewController's representedObject and NSArrayController's selection don't mix?
      • From: Jacob Lukas <email@hidden>
  • Prev by Date: Re: Using existing SQLite database with core data?
  • Next by Date: Re: NSVector, CGVector Additions
  • Previous by thread: Re: Problems with Split Views?
  • Next by thread: Re: NSViewController's representedObject and NSArrayController's selection don't mix?
  • Index(es):
    • Date
    • Thread