Alex Rivera | Logout

storing data locally on the iphone

Asked 2011-11-07T17:20:18.657
27

I am building an app where I'd like to store user information locally on the device, without using any server database - but everything on the device side. I am looking to store specific user locations and show it in a table view, and so even when the user launches the app later - I can pull the history and feed the history table with the past locations. Basically a read/write capability from a local database.

Now, I know that there were many questions like that before but I could not find one that addresses saving data locally without an external data base. I am not sure, for example, that using Core Data is the correct and simplest thing to do here.

Would appreciate any advice on that.

Edit
Report

1 Answer

4

if you just storing a few values and don't need any search logic, you could take a look into NSUserDefaults

[NSUserDefaults standardUserDefaults] 

its just an dictionary where you can store arrays, strings, int, objects and access by a NSString key

internally it's a just plist, so you can open it with xcode to quicky see the current state

answered 2011-11-07T20:35:04.403

Your Answer