views:

293

answers:

1

I noticed some iPhone apps give you the title screen instantly. Then there are some apps that gives you a black/blank screen for a brief moment.

I have the latter issue, but its lasting about 2 seconds. I would like to display a PNG image (over 200 KB size) and a loading indicator view.

My app is based on UIView. The specified a custom UIView that basically loads and renders the said image as the wallpaper.

I tried not loading this image, yet im still getting a 2 second delay time to load. The app delegate basically sets the view controller's view as a subview.

This delay is only seen on the device, not on the simulator. What am i over-seeing?

+4  A: 

If you place a Default.png file in your mainbundle, it gets displayed at launch time between the time that the app is tapped on till the time that you replace it with another view.

The reason you don't see it in the simulator is because it is faster at loading your app.

If you want to display a progress indicator, you will only be able to do it once the appDidFinishLaunching is called, but the delay that you are seeing is still there.

One trick I use is to have the same Default.png displayed again in appDidFinishLaunching and then draw a progress bar on top of that. Sure there is still the static display during the initial delay, but from there until all my initial views are loaded, I display a progress bar.

There have been some recent discussions about this on StackOverflow that you should see. And see this: How To Make Your iPhone App Launch Faster

mahboudz
holy smokes! that's the secret. thanks!
AlvinfromDiaspar
The secret is even bigger than you think. In many of the Apple apps, they show you a picture of what the screen looked like when you last ran it, making you think that the app is up and running instantaneously when in fact, the image is static. But Apple's the only one who can do this since we can not have a Default.png that changes (signed app and all). We have to make do with static displays such as logos or something that we can then add out progress bars to and make the user feel like we'll be done soon.
mahboudz
okay. this begs the question. How does the default Notes app load so quickly???
AlvinfromDiaspar
oic. i think you just answered my question. thanks again.
AlvinfromDiaspar
Try it out. Run one of Apple's apps and try to interact with it right away and you'll see it isn't actually reacting till a few seconds have gone by. It is pretty cool how they can fool you into thinking they're up and running. See the link I posted above.
mahboudz
yup. just tried it with the Notes app. so im trying to find an image tool so i can crop the screen shot from the simulator.any recommendations?
AlvinfromDiaspar
This is one way, either take a screenshot of the simulator, or better yet, run your app on the iPhone while attached to your mac and running XCode. Go to the organizer window and look at the screenshot tab. You can, right there, take a screenshot and turn it into the Default.png image. If you wan to edit it further, you can do a little bit with the Preview app, or get one of the many Photoshop variants.
mahboudz
And when you're ready, mark this question as answered. Thanks.
mahboudz