SWT
SWT

Reputation: 531

What's the best way to store data on iPhone?

i have made iOS apps using SQLite Database...

For this I read the guideline from Apple and found that "user can store files in the /Documents directory"

In my application, I am using single mode login. For this I am storing all user data (which are basically Sqlite db) to Documents directory. The Database is also present in the same directory which contains the details about the downloaded from web.

My question is,
1. Should I have to change the storing file location instead of to the Documents directory?
2. Where should my database file be placed?
3. don't want to delete database file after user deleting Apps.(if user installed again i want to show that same db)

If I put it Documents directory once user deleting apps from device it's removed all files.

Kindly guide me on this issue. Thanks in advance.

Upvotes: 1

Views: 277

Answers (1)

Dancreek
Dancreek

Reputation: 9544

  1. & 2.: Using The documents directory is fine.
  2. You can't retain data after an app is deleted. A better way to do this would be to have user accounts where a copy of a person's database is stored on a server. The user would just login and download their account info if they ever reinstalled. (see Parse.com for some awesome ways to do this).

Upvotes: 2

Related Questions