• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core data fetch returns no objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core data fetch returns no objects
      • From: Benjamin Stiglitz <email@hidden>
  • Prev by Date: determining system idle time in leopard
  • Next by Date: Modal dialog without NSApplication
  • Previous by thread: Re: determining system idle time in leopard
  • Next by thread: Re: Core data fetch returns no objects
  • Index(es):
    • Date
    • Thread