I'm simply trying to design a database schema upgrade scheme (for a family of applications using a proprietary database). What I'd like to have is a simple way to determine that the application has been reinstalled on the phone, with a different Xcode-generated version of the app from the previous version, so that we only go through the messy upgrade logic if there's been a change.
I considered simply using a timestamp of __DATE__
and __TIME__
stored in the app settings, but that captures only the compile date of the module containing the constants, and may miss builds that didn't force that module to recompile. And I suppose one could use the date on the bundle file, but that seems mildly flaky. (Any experiences with that scheme would be appreciated.) I looked for a build date stored inside the bundle but so far have not found anything.
Actually looking to see if there is a mismatch between the installed and coded versions is too expensive to do on every startup.
And of course I'm trying to avoid a scheme that requires manually modifying a version identifier in the app, since humans have a tendency to forget such things in the heat of battle.
(I'm fairly confident that someone is going to "dupe" this question very quickly. I don't mind that so long as the dupe really is addressing my question, and not just something that hits the same keywords.)