Optimizing load times of the currentModalViewController:
In my NiB, I have multiple View controllers. When the application starts up, all of their respective ViewDidLoad () calls are called.
in ViewControllerA, I have a ViewA that contains a UiScrollView with 100 pictures. In the initialization of these images in the ViewdidLoad. Thus, when the application starts, all images are initialized.
In my main menu view manager I have a button that is present when calls are clicked ModalViewController: ViewControllerA
This call takes 20 seconds.
I thought preloading in the ViewDidload would optimize this. However, once the call is returned and called (resuming this VC a second time, its really quick and instant).
So what is causing this? Why does it happen that the first time presentModalViewController. Internally, is he trying to organize all the images? Any way to optimize this? If not, what's the best way to show the UiActivityIndicator
Thanks in Advance
a source to share
It turned out to be too long for comment.
I would play around with the UITableView first to see if it can be applied.
If it's fully full screen then you have a UITableView in portrait, but rotate your shots in their cells. It will be identical to the landscape.
If the scrolling doesn't fill the screen, you can still try a UITableView with a transform to rotate it.
Then your next approach should be to put placeholders on the scrollview that lazily load images. If all images are the same size, it is very easy and you can optimize memory by keeping a limited number of these cells.
Another crazy idea: make it a UIWebView. This will do all the lazy load for you.
a source to share
First put some NSLog () statements in the -viewDidLoad methods. They are probably not called when you think. UIViewControllers are lazy. They don't actually download their NIB until someone looks at them.
If all calls to ViewDidLoad () are called, "you mean that you actually call [viewController viewDidLoad] manually, it won't work or do it. This is a delegate method that should only be called by the system.
You could, but should not, work around this by calling [viewController view]. This will put a strain on it, but this is almost always the wrong answer.
How big are the paintings? Do you really have a memory to keep all 100 all the time? Could you upload these photos as needed? What kind of figure are the pictures laid out? Can UITableView do a lot of work for you? If they are in the grid, you can show 4-5 images on the UITableViewCell and then you get all the optimizations of the UITableView.
a source to share