The following code:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if (viewController == [tabBarController.viewControllers objectAtIndex:0]) {
MySearchViewController *controller = viewController;
[[controller tableView] reloadData];
}
}
Yields the following warning:
Incompatible pointer types initializing 'MySearchViewController *__strong' with an expression of type 'UIViewController *__strong'
What would be the proper way to cast viewController into the proper class MySearchViewController to call its method?
Just change to this: