I have seen a bunch of similar questions but I want to make sure that my exact question is answered.
I'm about to release an app that uses 4 plist files that are stored on the device like so:
Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"myFile.plist"];
BOOL success = [fileManager fileExistsAtPath:filePath];
if (!success) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"plist"];
success = [fileManager copyItemAtPath:path toPath:filePath error:&error];
}
In the future if I make changes to the app, I do not want to overwrite these files. Users will be very mad if they lose all the settings in the files. Since the files are in the documents directory, I am guessing that the files would not be overwritten on an update. Also, when I delete the app in the simulator and reinstall, all the plist files are still in tact. I must "Reset Content and Settings..." for the plist files to be cleared out.
So am I correct that if I release an update in the future, it will retain my plist files?