Reputation: 424
My application needs to save several information about the user therefore I have planned methods to achieve this target. I managed this step by saving those information in two different location but I'm starting doubt about this, let me explain better:
Tutorial status. This kind of information support (as you guessed) the tutorial status, marking as accomplished those completed by the user in order to avoid to show over and over again the same tutorial. The way I handle this information is by saving into NSUserDefaults
.
Configuration. This kind of information contains the user configuration (a sort of little profile). This time the way I handle this information is by saving into a file called "UserData.plist" inside documentsPath
(code below).
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *PLISTPath = [documentsPath stringByAppendingPathComponent:@"UserData.plist"];
I'm creating the application in order to be ready to some updates. During those updates I don't want the user to lose any of those saved data. Am I doing something wrong or confused? Should I save everything inside NSUserDefaults
?.
Upvotes: 0
Views: 44
Reputation: 7637
1) Using NSUserDefaults
to save tutorial status is ok. Not very clear what you mean by "user configuration"
? Is it some sensitive data (password, email) ? If yes than it's not good to save it in a plist
without encryption.
2) User Defaults
is not deleted when app is updated.
Upvotes: 1