UIProgressHUD for View Delay...

Discussion in 'iOS Programming' started by bytezone, May 25, 2009.

  1. bytezone macrumors member

    Apr 20, 2009
    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...
  2. bytezone thread starter macrumors member

    Apr 20, 2009
    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..???

    id HUD = [[UIProgressHUD alloc] initWithWindow:window];
    [HUD setText:mad:"Downloading now..."];
    [HUD show:YES];

    // Kill the HUD after a delay
    [self performSelector:mad:selector(killHUD:)
    withObject:HUD afterDelay:2.0];
  3. bytezone thread starter macrumors member

    Apr 20, 2009
    Can anyone share their knowledge on this...I am stuck with this problem...!!!

Share This Page