Core Data Bindings: NSFaultingMutableSet...addObserver...notSupported
Core Data Bindings: NSFaultingMutableSet...addObserver...notSupported
- Subject: Core Data Bindings: NSFaultingMutableSet...addObserver...notSupported
- From: Brad Gibbs <email@hidden>
- Date: Wed, 30 Dec 2009 10:12:28 -0800
Hi,
I'm trying to bind through a keyPath, but I'm getting nothing but errors. The most common is:
[<_NSFaultingMutableSet 0x200267fe0> addObserver:forKeyPath:options:context:] is not supported. Key path: projectCode
I've read that bindings don't necessarily cause faults to fire, but I've got to believe there's some way to make this work.
I've been working on this for a few hours, I've looked through Core Data and KVO/KVC documentation, Googled and searched through the list. I may have read the answer without realizing it...
My data:
Account <--->>ProjectSite<--->>Project
I'm trying to get the projects array controller to load all projects for the selected Account (so, all Projects for all ProjectSites).
I've got an NSTableView listing accounts on the left, and view controllers to display detail table views to the right. One of the detail table views lists all ProjectSites for the selected Account. That's working fine. Another detail table view should list all Projects for the Account, but I can't get the Projects array controller to bind to the selected Account. These methods list all projects for the selected Account:
NSLog(@"Projects for account are %@", [self.selections.account valueForKeyPath:@"projectSites.projects.displayName"]);
NSLog(@"All projects for account are %@", [[self.selections.account allProjectsForAccount] valueForKey:@"displayName"]);
But, I can't translate that into the proper ContentSet binding for the Projects AC. I've tried every combination I could think of, including:
1. creating an Object Controller for the selectedAccount and binding the Project's ContentSet to that controller with projectSites.projects
2. creating an Array Controller for the selectedAccount's ProjectSites and binding to that
3. creating a managedObject subclass for Project with a method that returns [self valueForKeyPath:@"projectSites.projects"] and binding the projects AC's contentSet to that property
4. using combinations of @distinctUnionOfSets
I've seen posts with others having similar problems, but none of their solutions seem to be working for me.
Any help would be greatly appreciated.
Thanks.
Brad
_______________________________________________
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