tags:

views:

266

answers:

1

I am trying to add UiActivityStatus and Show a "Please Wait image' while presentModalViewController loads which takes 16 - 20 seconds...

The image shows up but then screen turns white right away and sits there for the 16-20 seconds. I am guessing the call to presentModalViewController returns right away.

Is there anyway around showing status when a call to presentModalViewController takes a long time.

PS: it takes a long time before i am loading some 100 pictures in that view

thanks!!

A: 

I assume you are loading the images in your viewControllers loadView. You can preload the view by sending it a view message [myViewController view] which will cause the load to happen. The view is displayed when you add it to the subview. so your code would be:

  1. Display activity indicator
  2. send view message
  3. push modal view controller
  4. hide activity indicator

I would advise you to modify your design though. A pause of 16-20 seconds with no user interaction is not good. Why not have the modal view active as the images come in. You could load each image that is visible first and whist they are loading you could display a spinner in their place.

Roger Nolan
My View Controller is in a NIB (along with other controllers). So when my app launches, all the VC launches as well. I have my pictures added to a scrollview in ViewDidLoad. So when the app launches, i guess this launches as well. I am not sure why its still taking that long when the presentModalViewController is called since its preloaded the images. Is there a delegate that is called when presentModalViewController is finished?