Quote:
Originally Posted by orrengg
I'm new to iphone programming and have a simple question (I think).
I've created an app using a tabbar with 4 views. In the appdelegate I initialize the model objects and in the viewcontrollers I determine if they need to be refreshed. This way the views come up quicker. (Is this the right way? I found that having the viewcontroller load up the model objects would cause a large delay in the showing of the view?) So, even after having the models initialize in the appdelegate there is a delay in the first viewcontroller showing. So I guess I need a loading view/screen.
So the question is: how do I get the loading screen to come up without delay?
I've tried putting code into the applicationDidFinishLaunching as he first thing - figuring after everything got loaded it would hit the "[window addSubview:tabBarController.view];". Still had the delay - and never saw the splash screen come up.
Next I tried putting in the awakefromnib on the first viewcontroller - while it did seem to hit the viewdidload of the splash screen, nothing again came up.
So where do you put it?
Thanks!
|
All you have to do id add an image named Default.png to your project (this will be the picture of the loading screen, prefferrably 320 x 480). Then add (1); to your appdelegate.m in the applicationDidFinishLaunching function:
- (void)applicationDidFinishLaunching

UIApplication *)application {
(1); ///This tells XCode that you have a loading screen
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
}