我有一个主 tabController 有两个选项卡,第一个被选为默认选项。按下 tab2 时,文件会加载到 webview 上,但您必须等待几秒钟。在选择 tab2 之前如何加载内容?I tried to call carrega (containing working ViewDidLoad code) function once tabController was set and is executed properly, however when tab2 is selected, content is blank... Thank you.
来自代表,
viewControllers = [NSArray arrayWithObjects:firstVC, secondVC, nil];
[tabBarController setViewControllers:viewControllers animated:NO];
[self.window makeKeyAndVisible];
[firstVC carrega];
[secondVC carrega];
//now few seconds later, tab2 will be pressed and should have content already loaded!
第二个视图控制器,
-(void)carrega{
//here my loading content code that if is on ViewDidLoad works great but with loading timeout
}