re: NSTreeController Core Data Duplicate Entries Problem
re: NSTreeController Core Data Duplicate Entries Problem
- Subject: re: NSTreeController Core Data Duplicate Entries Problem
- From: email@hidden
- Date: Thu, 10 Apr 2008 14:35:21 -0400
Hi Chris,
I think I have a solution for you. I've been having the same exact
problem as you, and while looking for the solution, I stumbled upon
your post.
then I stumbled upon the solution. I don't have a clear picture of
whats happening, but your duplicate entry problem centers on the
prepares content option in the tree controller in IB.
turn it off.
thats right, turning off the prepares content option in IB fixes the
duplicate entries problem.
Now for you... that might cause some other problem, but I can assure
you that my model object is very similar to yours and mine works now.
From: Chris Schmitt
Subject: NSTreeController Core Data Duplicate Entries Problem
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
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