My first update for the app was last night, and I received a complaint that the update caused the user data to disappear (some of them). I was able to reproduce the problem, but I can not understand why.
In the Documents folder, I saved one key file that tells me the "name" of all user files and their files (full path). Then all user files are also in the Documents directory.
When the update occurs, the key file still exists (at least I think this is because the data is displayed on the first screen of the application - the applications completely shut down and restart after the update, right?), But when the user tries to go to the actual files, there is no data, and any new data that the user enters is never saved.
It acts in exactly the same way as when debugging, when I accidentally used an invalid file name (with incorrect characters in it) - it was never saved. But with the update, these files were saved correctly in the old version, but somehow they do not work in the new version.
This is my first application and my first update, and I donโt understand at all here. I pulled the application out of sale at the moment (I did not know that you canโt just go back to the old version! Yikes!) And I will deeply appreciate any ideas on where / how to look for the problem and how to write a GOOD update that will not lose data. (For now, all I have found is to "save the data in the Documents directory, which I already did.)
I have an original application saved in his own project, and I can go back and work with it again. I copied this entire directory when I started working on the update, and I am wondering if this could somehow be the problem? I changed the name of the directory in which all Xcode files are stored, and used the Project> Rename function. Could this have such an effect?
The application (both the original and the update) works on 4.2 and higher, if that matters.
Decision:
I believe that I understood this problem. As I said at the beginning of my question, I saved the FULL path of user files in my key files. Apparently, after the update, it is not guaranteed that the full path will not be the same (I'm sure it is registered somewhere somewhere, but I did not come across it).
So, the custom HAD files were moved to the new Documents directory, but I searched for them in the old absolute path, that is, not in my sandbox.
Fixed by putting a loop in the didFinishLaunching application to pull out the offending file of the file paths (THAT, I always searched locally and it still worked) and chopped them off only to the NAMES file. The path to the documents must be found and added programmatically whenever file operations are performed.
For me, it was really useful for me that there is no way to return to the previous binary in the store, because reinstalling the original version would not fix the userโs problem, but I would believe that it was, at least initially. I would like to have a way to decline UPDATES, but still allow new purchases (since the problem did not affect new purchases). This is probably not a common enough situation to guarantee this.