0

what i need is when someone clicked on tabBarItem 0 it will reload the page

I have tabBarController in my AppDelegate.m file

my problem is how to call webview in MainView.m to reload

i use code to check which tabBarItem was clicked and its work fine

(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {

    NSLog(@"TabItem pressed");  

    if (viewController == [TabBarController.viewControllers objectAtIndex:0]) {
        NSLog(@"Tab 1 was pressed");  


    }
}
peter_budo
  • 1,748
  • 4
  • 26
  • 48
Bosoud
  • 158
  • 4
  • 24
  • Did you figure out the problem, and if so, what was the solution? I really want to know how to pass a loadRequest to the viewController in this context... –  Aug 06 '11 at 23:22

1 Answers1

0

Are you trying to reload data?

If you are, then you can put something like:

if (viewController == [TabBarController.viewControllers objectAtIndex:0]) { 
NSLog(@"Tab 1 was pressed"); 
[self.webView reloadData];
}
K.Honda
  • 3,106
  • 5
  • 26
  • 37
  • Thanx for replay webView is in MainView.xib And am writing the code in MyappDelegate self.webView i get error @K.Honda – Bosoud Jun 18 '11 at 06:12
  • i got this error " Property 'webView' not found on object of type 'MyAppDelegate *' " – Bosoud Jun 21 '11 at 08:48