I am creating an app in which I have five tabs. I need to reload each controller every time when tab is pressed.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//other codes
[self.tabBarController setDelegate:self]
//other codes
}
// UITabBarControllerDelegate method.
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if ([viewController respondsToSelector:@selector(reloadDataTemp)]) {
[(YourViewController *)viewController reloadData];
}
}