Nitin
Nitin

Reputation: 7471

How can maintain some user settings as it is after app is updated with new version?

I want save user note which can not be remove if they update app version.

//http://iphoneworxx.com/sample-code-ios-iphone-and-ipad

Upvotes: 0

Views: 60

Answers (2)

Thomas Nadin
Thomas Nadin

Reputation: 1207

Files can be saved into the Documents directory:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];

And any object (including a few primitives) with NSUserDefaults:

NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefauls];
[userDefaults setObject:anObject forKey:@"ObjectKey"];
[userDefaults synchronize];

NSObject* anotherObject = [userDefaults objectForKey:@"ObjectKey"];

Upvotes: 1

rckoenes
rckoenes

Reputation: 69479

All data not stored in the application bundle is preserved during upgrades.

Since the Application bundle is read only on the device you are not able to store any data there. So you should be ok.

Upvotes: 2

Related Questions