I have an iOS app written in MonoTouch – with each new version, new features are added and I need to add additional fields to the database or perform data maintenance tasks (sometimes these could take a minute or so to run). In many cases, the data/schema will need to be updated before we can allow the user into the application – Is there a standardised way or place in Obj-C or Monotouch to perform these maintenance tasks on startup? Ideally I would want to display a loading display to the user to let them know this is a one time only thing.
My thoughts so far:
-
Placing them in FinishedLaunching within the AppDelegate, but it seems like the wrong spot.
-
Changing the home view to a view which only upgrades their database and then pushes them on to the next view, but this seems like overkill.
That’s how I do it (here is an example) in a few of my apps.
What I do is check in the AppDelegate
FinishedLoadingif this version needs the schema updating, and if it does I make thewindow.RootViewControllera DialogViewController which uses theDefault.pngas the background, and then do my updates from there.This gives the illusion that a progress bar has shown over the top of your splash screen.
For a loading screen you can use ATM Hud to display a progress bar to the end user.