Core Data issue .. where is my bug?
Core Data issue .. where is my bug?
- Subject: Core Data issue .. where is my bug?
- From: Robert Lorentz <email@hidden>
- Date: Mon, 14 Jun 2010 01:32:22 -0400
Ok I have a core data .xcdatamodel created, and I've trimmed it down to include:
Entity: MyType
has attributes: name (string), description (string) - both have default values, both not-optional.
I have set up an NSTableView with + and - buttons to add or remove MyType to an NSArrayController I call "array controller". The table view is set up to display "name". This works, I can add and remove names all day long, edit their values, etc. My bindings all appear to be good there. (I'm binding Content and I'm binding Value)
I have also bound "selectionIndexes" from the tableview to the array controller's 'selectionIndexes'.
I have created a NSTextField. In the text field, I can set it's value to "array controller - selection.name" .. if I do this, the text field shows the same data as the name row that I click on in my NSTableView. If I edit it in either place, it updates.
Now - this is where my issue starts - if I instead bind my NSTextField to "array controller - selection.description", my program crashes with EXC BAD ACCESS! I have edited the store file, and confirmed that yes I do have attribute entries for "name" and "description" both.
My bindings of selectionIndexes and selection are intended to say: when you click the name of this MyType, really I am selecting the index of the MyType entity in the array controller (since the array controller is set up to manage entities of type MyType..) So, when I then go to array controller and bind to "selection.description" I see no reason why it wouldn't return back the right data.
<object type="MYTYPE" id="z130">
<attribute name="name" type="string">4</attribute> <attribute name="description" type="string">Default MyType Description</a
ttribute>
</object>
Any help is appreciated as I've fooled with this for quite a while now. I'm also very unclear as to how to constructively debug this sort of thing, I don't know the tools well but it all seems very "behind the scenes"... so tips as to how to debug it better appreciated._______________________________________________
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