I have an iPhone app that stores some settings using NSUserDefault standardUserDefaults
.
When I add new features to the app I need to add new default settings and so I have to migrate/upgrade the NSUserDefaults
. For now, I just store the version number and check this when the app is launched. It has quickly become very messy as I have to add lots of if statements. I cannot assume that the user is just upgrading from the previous version but perhaps even a couple of versions before.
I like the way that CoreData seems to handle migrating table changes but I want to provide 2.2.1 SDK compatibility and of course CoreData is not the same thing as NSUserDefaults
.
Any suggestions or best practices?