Coredata and NSOutline with NSTreeController Weirdness.
Coredata and NSOutline with NSTreeController Weirdness.
- Subject: Coredata and NSOutline with NSTreeController Weirdness.
- From: James Andrews <email@hidden>
- Date: Mon, 12 Sep 2005 14:40:47 -0400
OK, so I have a weird thing happening with my little micro app.
I have a CoreData Application with one Entity called Grouping.
Grouping has 1 attribute called group_name and 2 relationships. one
called parent and one called children. children is a To-Many
relationship to itself and parent inverses children but is not a To-
Many relationship.
I have an Interface with 3 buttons a window and an NSOutlineView. I
create an NSTreeController called Groupings which is in Entity Mode
to Grouping. The children key path is set to "children"
underbindings I have it Bind to AppNameAppDelegate and Model Key path
is managedObjectContext. The row(i only have one row) identifier of
the NSOutlineView is called group_name.
3 buttons are add, child, and remove and are mapped to the
NSTreeController's add,insertChild,remove actions respectively
I compile the app, and it compiles cleanly(which is usually a good
sign). I launch the app, and click the add button, it adds a row to
the NSOutlineView. I can then click on it and edit it's name as it's
editable. I click on remove and it removes it. If I click on add,
and then try to add a child is where I get my weirdness.
When I click on the child function It does create a child, but then
it also creates another node the level up (ie at the childs parent
level. If I try to remove that parent then it also deletes the
child., but it shouldn't because it's the child of the other parent
node.
I'm confused, any ideas?
James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden