I'm using NSCoding
to encode my objects and save them to disk as a "caching" feature not having to download data every time my app is started. Right now I'm saving this data in the Documents folder of the app which I have read is not deleted when updating the app.
So my concern is that I do some update to my class like adding an instance variable. And then uploads the app to the App Store. So when the user updates to new version the old objects that are saved in the Documents folder are encoded without that new instance variable that I had added in the new version. So that when my app will try to decode the saved objects during startup it will fail because the "old" objects from the Documents folder were not encoded with this new variable?
How would I deal with this problem? Make sure I write my classes "right" from the start? I'm sure I will eventually need to modify one of my classes and then break the old saved objects on disk.