我需要的是当有人点击tabBarItem 0时它会重新加载页面
我的AppDelegate.m文件中有tabBarController
我的问题是如何在MainView.m中调用webview来重新加载
我使用代码来检查单击了哪个tabBarItem并且其工作正常
(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
NSLog(@"TabItem pressed");
if (viewController == [TabBarController.viewControllers objectAtIndex:0]) {
NSLog(@"Tab 1 was pressed");
}
}
答案 0 :(得分:0)
您是否正在尝试重新加载数据?
如果你是,那么你可以提出类似的东西:
if (viewController == [TabBarController.viewControllers objectAtIndex:0]) {
NSLog(@"Tab 1 was pressed");
[self.webView reloadData];
}