IOS app update, how to update the plist bundled?

Is there a way to update a modified plist file that is bundled with an iTunes app update?

I have an application that stores some data in a plist file as an array and dictionaries. In some updates, I added more elements of the array to the plist file, but it seems that when the application is updated, the new plist file is not copied and updated until the user uninstalls the application and reinstalls it.

How do I get an application to update a local copy of a plist file using a new one?

+4
source share
3 answers

You cannot update any part of this package. Save the plist in the document directory if you want to update it.

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

Files in the document directory are not deleted when updating the application using the repository.

+5
source

Supported .plist files? For instance. MyApp-YYYYMMdd.plist

+1
source

I had a similar problem in the application. What I did for the address is to check whether the application downloaded the old or new version of the plist file when the application receives a notification willEnterForeground in the application’s folder, and then downloads the new file from the package and stores it in the documents directory.

0
source

Source: https://habr.com/ru/post/1348137/


All Articles