Re: Searching for an entity in a relationship (CoreData)?
Re: Searching for an entity in a relationship (CoreData)?
- Subject: Re: Searching for an entity in a relationship (CoreData)?
- From: Chris Hanson <email@hidden>
- Date: Sat, 3 Dec 2005 19:57:08 -0800
On Dec 3, 2005, at 7:45 PM, Mike Nowak wrote:
But then I noticed it would get data for a year I had deleted in
the UI. I tried changing the fetch request to use year == $year and
stock = nil but that didn't make a difference. When I save the data
in XML format, I can see that the Stock only lists the YearData
entities I expect but the deleted YearData entity still points to
the Stock entity. (I was surprised to see the deleted YearData
entity in the saved file at all.) I tried various delete rules to
unhook the deleted entity but to no avail.
A couple things come to mind. First of all, if your relationship
maintenance is messed up even though you have inverses, I suspect you
have a no-action delete rule somewhere. If you want deleting a
YearData to delete the objects on the other side of its stock
relationship, use a cascade delete rule on the stock relationship.
Also, if the YearData objects are still in the file, it sounds like
they were only removed from relationships rather than deleted. This
could be the case if you have YearData being shown in a table view
managed by an NSArrayController that gets its data from a contentSet
binding. The contentSet binding has a setting to indicate whether it
should delete objects upon their removal; I believe this is off by
default.
-- Chris
_______________________________________________
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