Binding problem with core data
Binding problem with core data
- Subject: Binding problem with core data
- From: Velocityboy <email@hidden>
- Date: Wed, 30 Jan 2013 22:41:40 -0800
Hi all -
I'm having a problem binding to Core Data. Here's my setup: I have data rows which contain a category and subcategory; the subcategory set is dependent on the selected category. (For the sake of argument, say the category is "state" and the subcategory is "counties in the state".) In my CD schema, I have a Category entity which has a a one-to-many relationship to Subcategory. Each row of the actual data has a 1-1 relationship to a Category and a Subcategory.
My interface has a table; two of the columns map to the category and subcategory. I have an array controller for the main data structure (Row Controller), and another for the top level category values (Category PopUp Controller). My bindings for the two columns are set up like this:
Category column:
Content - Category PopUp Controller.arrangedObjects
Content Values - Category PopUp Controller.arrangedObjects.name
Selected Object - Row Controller.arrangedObjects.category
Subcategory column:
Content - Row Controller.arrangedObjects.category.subcategories
Content Values - Row Controller.arrangedObjects.category.subcategories.name
Selected Object - Row Controller.arrangedObjects.subcategory
Category PopUp Controller sources from a simple entity name. Row Controller is sourced from another table (Root Controller.selection.rowData) which is backed by a different core data entity (Row Controller's objects are a one-to-many relationship from each entity represented in the root table.)
I see two bizarre behaviors: when I change the Category value with the popup button cell in one row, Category values in other rows change. When I change the subcategory, I get an exception:
2013-01-30 22:32:23.192 Testapp[10506:f03] -[_NSFaultingMutableSet objectAtIndex:]: unrecognized selector sent to instance 0x101d5dfd0
I built a small test app which used simple objects with properties to implement the category and subcategory data sets, and just hung the categories as an NSArray off of the app delegate, then used the same binding scheme pointing at those rather than using Core Data. There, the bindings worked as expected.
I'm obviously misunderstanding something fundamental about how bindings into Core Data work. Anyone have any advice?
Thanks in advance!!
_______________________________________________
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