danielson317
danielson317

Reputation: 3288

How do I create a default database for an iphone app?

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

Answers (3)

Vishal
Vishal

Reputation: 556

Go at bolow Link

http://deviphonesdk.blog.com/?p=42

This is the easiest method for work with database.

Upvotes: 0

Paresh Navadiya
Paresh Navadiya

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

BornCoder
BornCoder

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.

Core Data Programming Guide

CoreDataBooks - Core Data Sample code

I hope this may help you.

Upvotes: 0

Related Questions