NSTreeController Core Data Duplicate Entries Problem
NSTreeController Core Data Duplicate Entries Problem
- Subject: NSTreeController Core Data Duplicate Entries Problem
- From: Chris Schmitt <email@hidden>
- Date: Mon, 14 Jan 2008 12:16:36 -0500
I have a simple core data application set up with 1 entity for
tracking folders. This entity has a circular reference to itself to
mark the Children and Parent objects. I then added an
NSTreeController to a simple form and hooked it up to an
NSOutlineView. After hooking up the bindings and a add and delete
button I can add records to the tree controller and the display works
fine.
My problem is, when I reopen the application the data was not being
loaded into the NSTreeControl, so checked the prepares content button
and my data showed up. Now when I add a new child entity to one of my
existing entities I get a duplicate parent created.
Example:
Folder 1
Child 1
Folder 2
When I add a Child 1 to Folder 1 I get the following:
Folder 1
Child 1
Folder 2
Child 1
Folder 3
The child record is being created, but a new parent record (Folder 3)
is also being created. The add button is hooked up to the addChild:
method on the NSTreeController.
How do I stop this duplicate entry problem?
Thanks in advance.
Chris Schmitt
_______________________________________________
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