Re: Removing an object from an ArrayController...
Re: Removing an object from an ArrayController...
- Subject: Re: Removing an object from an ArrayController...
- From: Colin Doncaster <email@hidden>
- Date: Thu, 18 Jan 2007 11:35:17 -0500
That makes sense ( they are definitely set up with inverse
relationships ).
Is there any guidelines for developers on what Apple thinks should be
the correct behaviour for "orphaned" objects? Especially if a
"parent" relationship ( to-many relationship ) has been created and
the parent is removed?
I imagine it's application dependent, Mail seems to delete all of the
emails in a folder when you delete that folder - though it would seem
safer to either not let the user delete the folder unless it was
empty or, if there were any messages within the folder, "orphaned"
messages would be assigned to Inbox. I know it's very specific to an
application in question.
Cheers.
On 18-Jan-07, at 11:03 AM, Scott Stevenson wrote:
As a side note, if the remove actually just breaks the
relationship does that mean there's a chance a lot of unassociated
objects can live within the graph with no way ( unless I write a
method for inspecting the graph for them ) to clean them up?
Assuming you have inverse relationships set up, you can just look
for "orphan" objects by searching for null relationships (using an
NSPredicate with a NSFetchRequest).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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