views:

322

answers:

3

I save some strings and numbers to NSUSerDefault, but when I uninstall and reinstall the app the data is ereased.

Is there a possibility to store data some where else? Maybe in keychain?

A: 

You could stash a small amount of data in the comments field of a keychain record.

However, I doubt Apple would allow it because it would violate the principle of sandboxing the apps. It's hard to think of a legitimate reason to have an app leave data behind after it's gone.

TechZen
There are some in-app purchase cases where you'd like to make sure that content remains unlocked if a user accidentally deletes the application from their device.
Brad Larson
A: 

rename them when you exit your app to something that won't be overwritten next time you reload, then rename them back when your app restarts.

I do it always with my database as I need it to be intact for iterative development.

Otherwise, you can copy the data from your app to your machine for viewing at a later date:

Organizer -> Devices -> your iphone -> Summary -> Applications -> your app, click on the triangle to show the Application Data, which you can download.

KevinDTimm
A: 

There are two places where you can store data that will persist after an app is deleted, but in both cases, it's not hidden data, so if that's what you're looking for, you're out of luck.

Your two possibilities are 1) Saving data to the photo library. (However, you can't read it back unless you get the user to select the photo for you.) 2) The address book. This is one place where you can create an entry and select it without user input.

Douglas Mayle