Core data fetch returns no objects
Core data fetch returns no objects
- Subject: Core data fetch returns no objects
- From: Tomaž Kragelj <email@hidden>
- Date: Thu, 18 Sep 2008 14:05:03 +0200
Hi all - I need some help with core data fetching...
I have 1:N relationship between Project and Measurement entities. I
add all objects to managed context programatically using +
[NSEntityDescription
insertNewObjectForEntityForName:inManagedObjectContext]. First I add
Project object, then I add all child Measuerements as needed. After
the objects are added or updated, I save the data to XML files (the
two object types are saved to different persistent stores).
This works fine, the files save and load correctly. When I later want
to fetch the measurements in my custom NSTableView data cell to draw
the statistics, no measurement is fetched (I get empty array).
If I use the same code for fetching immediately after adding the
objects to the context, the fetching works... It looks like the
problem might be related to fact that I use different persistent store
for Project than for Measurement - if I fetch other objects saved in
the same persistent store, fetch works.
Any ideas? Cheers, Tom
_______________________________________________
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