dinny
dinny

Reputation: 17

database in iphone apps

I am new to iphone development. I am currently doing a restaurant app which takes data from a database. How can we store the data in a DB on iphone through our app so that it would even work offline?

Upvotes: 1

Views: 129

Answers (3)

DShah
DShah

Reputation: 9866

For Restaurant app, you can also use plist as a database. This is because you will only have a primitive datatypes and will be easy to handle with plist.

Upvotes: 0

Nils Munch
Nils Munch

Reputation: 8845

You should use SQLite. Since the database is just a file, you can add the 50 MB file to your application, and that's it. SQLite's performance on the iPhone is good, in my experience, although YMMV depending on your exact table layout and indexes.

Just remember to keep a keen eye on how much data you fill it with:

Although 50 MB is way below the limit, be aware that a 50 MB application will take some time to download for people, and people cannot install it from the AppStore without either a WiFi connection or iTunes.

Also, applications that "grow" in size too rapidly after you install them can become unpopular on the smaller devices.

Here is a tutorial

Upvotes: 1

Kye
Kye

Reputation: 4495

Yes, SQLite is your best bet. Apple uses SQLite a lot in iOS 'internally' (DB for text messages.etc), so Apple must've put a lot of effort into optimising SQLite on iOS.

Upvotes: 0

Related Questions