I have done a login for my app, so, to finish it, I modified the method didfinishlaunching from the delegate.
In this method, I take the session from the userdefaults and check if is valid(calling to my server). If it’s correct, I load the main viewcontroller, if not, the login viewcontroller.
The problem is that in the method didfinishlaunching I dont load any viewcontroller, because I am waiting the response from the server. I load the viewcontrollers in the connection’s delegate. This causes me 2 problems:
- An error telling me I have to have one main view controller loaded
- If I do, I put an viewcontroller, the time that I am waiting the response that viewcontroller is displayed, and it’s very ugly.
I think that one solution may be to do another viewcontroller, only with a loading bar, and load it while I wait the response…
I did exactly what you are talking about in an app I’ve made: at the beginning I create a “SplashScreenViewController”, that has an UIImageView equal to the image I use as a splashscreen for my app.
Here I have a loading wheel and I load every kind of data I need. When I receive every data I need, I load my root controller.
You can do the same, but you can load your controller relating to the session status.