On 12 May 2010, at 17:54, sebi wrote:

> Hello,
> 
> How can I find out if my first view is up and running? When viewDidAppear is 
> called on my fist UIViewController I'm still looking only at the Default.png.
> 
> What I do first in my app is:
> 1. wait for viewDidAppear to be called
> 2. show some wait-indicator
> 3. load some data from the net
> 4. hide the wait-indicator
> 5. display the loaded data
> 
> The problem is, that the Default.png doesn't go away until the data is fully 
> loaded, so the user only sees a passive screen for some time and doesn't know 
> what's going on.
> Where can I start the wait indicator and download process so that the user 
> actually sees it?
> I use some NavigationControllers within a TabBarController, could that be the 
> problem? 

It sounds like you're not handing control back to the run loop at any point in 
this process.  What you probably want to do is this instead:

Main Thread:
1. wait for viewDidAppear to be called
2. show the wait indicator
3. Start thread B
4. Hand control back by leaving your method's scope

Thread B:
1. Load some data from the net.
2. use performSelectorOnMainThread:... to fire off a message that the data has 
finished loading.

Main Thread:
1. On receiving said message, hide the wait indicator
2. display the loaded data.

Bob_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to