One of the things I miss from moving from SQLite to Core Data is the ability to query directly against my database to analyze data. Is anyone out there aware of a tool that allows for the browsing of a Core Data store in a similar fashion?
The next time you need to store data, you should have a better idea of your options. Core Data is unnecessary for random pieces of unrelated data, but it's a perfect fit for a large, relational data set. The defaults system is ideal for small, random pieces of unrelated data, such as settings or the user's preferences.
The persistence part of Core Data is backed by SQLite, which is a relational database.
Core Data can use SQLite as its persistent store, but the framework itself is not a database. Core Data is not a database. Core Data is a framework for managing an object graph. An object graph is nothing more than a collection of interconnected objects.
The persistent store should be located in the AppData > Library > Application Support directory. In this example you should see a SQLite database with extension . sqlite. It is possible that you don't see the persistent store in the Application Support directory.
CoreDataEditor is $20 and doesn't make it quick and easy to browse the relationships of the managed object context. There was also some insanity about having to have the MOM use exactly the same name as your application (??!), or somesuch. I'm not about to go in and start renaming stuff just to browse my object store. Admittedly, it does have a pretty cool application icon, and I assume from the name that you can edit stuff. But, like the original poster, I just need something that will let me crack open a Core Data persistent store and quickly grok my managed objects.
I've found that a much better solution, one which offers intuitive and easy browsing of the relationships of managed objects, and which is free, is detailed here:
Browsing Core Data databases using F-Script
You basically install F-Script, and then run Mr. Tyson's Applescript, which asks you to locate your MOM (e.g., YourApp.app) and then the SQLite database that is being used as the persistent store (i.e., YourAppPersistentStore.sqlite). If you are using the iPhone Simulator, these are both in your Simulator directory -- for example:
/Users/me/Library/Application\ Support/iPhone\ Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/YourApp.app /Users/me/Library/Application\ Support/iPhone\ Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/Documents/db/YourAppPersistentStore.sqlite
Then select an Entity and hit 'fetch'. You can run a NSPredicates to filter its items, or click on an item and click 'Browse'. It opens "F-Script Object Browser" and from this window, you can follow relationships and basically tour all the items in your entire managed object context, inspecting all the attributes for each item. It's super awesome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With