Reputation: 7471
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
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
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