Reputation: 3288
I'm just leaning iPhone app development and I've figured out how to read and write database info. However I still haven't found sufficient info on how to set up a default database with all the initial values.
Example I want a database with a list of fruits. It will initially contain all the values I can think of such as apple, pear, orange, apple etc. When the app loads the first time this should already be part of the database. The user can then edit these values.
I don't want to have to put the info in a flat text file and import it on initial launch. I think that's kind of lame I'd rather just have an initial database file.
Upvotes: 0
Views: 449
Reputation: 556
Go at bolow Link
http://deviphonesdk.blog.com/?p=42
This is the easiest method for work with database.
Upvotes: 0
Reputation: 38239
U can use SQLite Database for your requirement.
Refer phone-sdk-tutorial-reading-data-from-a-sqlite-database link. It also contains sample
Upvotes: 1
Reputation: 1066
iOS Core Data can be the best answer. While creating project select core data option. It will create sample basic structure for you to interact with database. You do not have to worry about writing queries, Core data and its model classes and APIs will tale care of it. Below are useful links where you can get more information.
CoreDataBooks - Core Data Sample code
I hope this may help you.
Upvotes: 0