• 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 fails to retrieve all data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data fails to retrieve all data


  • Subject: Core Data fails to retrieve all data
  • From: August Hahn <email@hidden>
  • Date: Wed, 17 May 2006 17:17:28 -0700

I have an app that handles geographic locations. I've put in a model that has regions of the country (defined by north latitude, south latitude, east longitude, and west longitude) and locations defined by latitude and longitude. If I create the database, reading in the regions from an XML file and the locations from a text file, the search function to decide what region a location is in, returns the correct result.

For example, I have regions starting with the World, which contains North America, West Coast, Washington, Puget Sound, and South Puget Sound (each of which is smaller in area and totally enclosed by the previous region). If I query for the region that contains Olympia, Washington I see the predicate formed correctly (in the form "north > 47.0893 and south < 47.0893 and west < -122.85 and east > -122.85) and all the above regions are in the array. All is well.

If I then rebuild the locations by removing all of them from the database, saving the context, and re-entering the locations, the search for regions with the exact same query as before only returns World, North America, and West Coast.

I've examined the store using a SQLite manager and the data is there, and the same query in SQLite terms returns all the regions. If I turn the Core Data debugging to 2 I see the query going to the store (and it's correct), yet the store returns only 3 regions, not all 6.

I've tried changing to a binary store and the query seems to work both times there, but the slowdown is dramatic and so I've gone back to the SQLite store.

The store is not set up as Read-only.

I've been thinking that maybe the delete is somehow messing up the store or the context, so I've been thinking about creating two stores, one for the locations and one for the regions - but before I go to that much work, I was wondering if anyone else has come across something like this and how they handled it. It's very frustrating not being able to get the data out! It makes me wonder if Core Data is worth the effort.

August

_______________________________________________
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


  • Prev by Date: Making newly inserted row visible in NSTableView
  • Next by Date: Re: returning value in a function argument
  • Previous by thread: Re: Making newly inserted row visible in NSTableView
  • Next by thread: Core Data / NSPredicate - faster alternative to JOIN?
  • Index(es):
    • Date
    • Thread