Searching for an entity in a relationship (CoreData)?
Searching for an entity in a relationship (CoreData)?
- Subject: Searching for an entity in a relationship (CoreData)?
- From: Mike Nowak <email@hidden>
- Date: Sat, 3 Dec 2005 22:45:02 -0500
Okay, this is probably easy but I can't figure it out after trying
several things and reading the docs so I must be just missing
something. Any help would be appreciated! I have 2 entities: Stock
and YearData and Stock has a to-many relationship of YearData
entities called annualData and YearData has the inverse to-one
relation of a Stock entity called stock. YearData has a property
called year to indicate the year the data is for, along with a bunch
of other properties. Everything was working great. To get annualData
for a year, I use a fetchRequest on YearData entities where year =
$year.
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.
What is the proper way to find the entity in the relationship and
make sure it is still in the relationship?
Thanks again for any help.
--
Mike Nowak
Work:
http://healthmedia.umich.edu/
Personal:
http://snackdog.org/
_______________________________________________
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