Reputation: 1203
I have UITabBarController that has two tabs .Every tab load a file from internet . so when I use
tabBarController.viewControllers = [NSArray arrayWithObjects: vv1,vv2, nil];
it download vv1 and vv2 at the same time so the program is very slow .
Is there away to download the first view vv1 and the download the second view by clicking it ?
Upvotes: 1
Views: 1032
Reputation: 69027
You can use so called "lazy loading".
That would mean that, instead of doing the web stuff in the controller init method, you do that in
[viewWillAppear][1]
,
or in your tab bar controller delegate
[tabBarController:didSelectViewController][2]
.
This will surely reduce the lag when creating the tab bar.
Upvotes: 3