KexAri
KexAri

Reputation: 3977

What happens to files stored in the documents directory when an app is updated?

I couldn't find the answer to this anywhere but I am saving various files in my app to the documents directory using archiving. If I release an update for the app and the user installs it what happens to these files? Will they be deleted?

code to get to documents:

//get the directory
    NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

   //set it to a string
    NSString *documentDirectory = [documentDirectories firstObject];


    return [documentDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@stickers.archive",[PFUser currentUser].username]];

Upvotes: 0

Views: 402

Answers (1)

luk2302
luk2302

Reputation: 57184

No, the files will remain.
You can then go ahead and change them as part of the update or just use them like before.

But you should be careful how you reference the saved files, since they will be in a new directory after the update: App Updates, NSURL, and Documents Directory Basically you should only save the relative path from the documents directory, that will remain unchanged as well.

Upvotes: 1

Related Questions