SamehDos
SamehDos

Reputation: 1203

UITabBarController slow loading

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

Answers (1)

sergio
sergio

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

Related Questions