Best way to import seed data into app database
Fri, 11/11/2011 - 04:45
I have a web app that has a couchdb database of about 1000 articles that I want to create a stand alone iOS app from. I'm using PhoneGap to provide the web view/app bridge.
What is the best way to bundle/seed the app's database from the master version on build? The app needs to ship with all the data and be self-contained so I don't want to sync on first start up.
Many thanks
Tom
After you’ve created the database somewhere, find the .couch file that contains its data and add a copy of it to your project as a resource. Then at launch time, use NSBundle to look up that resource and pass the path to -[CouchbaseMobile installDefaultDatabase:].