Hi there, i am doing some experiments with coredata and objective-c. My application works fine in the simulator.
It also works on my iPodTouch. But how to i copy my local database to my device?
thanks,
Hi there, i am doing some experiments with coredata and objective-c. My application works fine in the simulator.
It also works on my iPodTouch. But how to i copy my local database to my device?
thanks,
Check the question titled: How do I use my existing SQLite database with Core Data? in the Core Data FAQ.
You might also find this blog post helpful.
Has anyone tried this? http://tom.wilcoxen.org/2008/11/28/build-and-compile-your-sqlite-database-with-xcode/
Copy the sqlite file out of the simulator directory structure (under ~/Library/Application Support/iPhone Simulator) and put it into your project to be included in the Resources directory. Once there you can either:
Depending on your application needs.
This is the solution (Thanks Marcus S. Zarra)
Change this
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Locations.sqlite"]]
into this:
NSURL *storeUrl = [NSURL fileURLWithPath: [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: @"Locations.sqlite"]];