PDA

View Full Version : UIProgressHUD for View Delay...




bytezone
May 25, 2009, 11:51 AM
Can I get some help on this..

I am trying to move to View2 from View1 by clicking a "move to View 2" button on view 1. View 2 needs to load lots of images so it takes more time to show up. I am also implementing view animations to switch to view 2. The animation does not look good as View2 takes too much time to get prepared to display.

How can I use UIProgressHUD to resolve this. I would like the users to see a 'Waiting Window" while being on View 1 and move with smooth transition to View 2.
Thanks in advance for the help...



bytezone
May 25, 2009, 12:50 PM
Thought this might help in analyzing the issue..

My code looks as follows..
I added the code to laod images before issueing KillHUD but after HUD show:YES.

after loading the images, I am issuing UIView animations to display the View 2 by adding it as subView to window. In doing so, waiting message does not show up and view transition starts taking place slowly. However if I don't try to show view2, then waiting message shows up for the delay specified. Any idea how I can make the transtion to take place for showing the waiting message while being in view1..???

<CODE>
id HUD = [[UIProgressHUD alloc] initWithWindow:window];
[HUD setText:@"Downloading now..."];
[HUD show:YES];

// Kill the HUD after a delay
[self performSelector:@selector(killHUD:)
withObject:HUD afterDelay:2.0];
</CODE>

bytezone
May 25, 2009, 04:03 PM
Can anyone share their knowledge on this...I am stuck with this problem...!!!