views:

223

answers:

2

Hello,

I am a newbie in the iPhone dev and I want to know if I will save some data(NSSDictinary) with NSKeyedArchiver, tis data persist after an update process of my app via AppStore? Let's say that I want to save user an pass for my app and probably this information will be saved into the app folder.If I will update the app via AppStore with iTunes, the old data saved are still there?The user will find his saved login credentials?

Thanks,

Alex.

+1  A: 

You should use the NSUserDefaults to store such settings. It will write the information to a directory that will be preserved accross syncing, restoring a backup and application upgrades.

Alternatively you can use the Keychain to store the username/password. This is more secure, and it will also survive application updates or syncing / restoring a backup.

St3fan
A: 

Just make sure you save the data to the app's document directory (using NSKeyedArchiver archiveRootObject:toFile:).

Files Saved During Application Updates
Updating an application replaces the previous application with the new one downloaded by the user. During this process, iTunes installs the updated application in a new application directory. It then moves the user’s data files from the old installation over to the new application directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:

/Documents /Library/Preferences Although files in other user directories may also be moved over, you should not rely on them being present after an update.

Getting Paths to Application Directories

bddckr
Thank you very much guys.I really appreciate you help.Alex.
Just make sure to flag an answer as accepted.
bddckr