Good afternoon everyone.
I'm trying to refresh a list from another class. There is a view controller class that adds the list controller class as a subview. I wrote a method in the App delegate that gets the list's view controller class. I'm getting a warning from this code, and the App will crash when it reaches the line in bold
Warning: tabBarItemController may not respond to '-getListViewController'
I used getter/setter methods so that listViewController should be available. So I think the problem might be how I am getting the view controller from the tabBarController.
Code:
- (void) refresListViewController {
NSLog(@"Delegate: getting View Controller");
tabBarItemController *vc = [tabBarController.viewControllers objectAtIndex:1]; // This might be the problem line
if (vc != nil) {
NSLog(@"Delegate: getting listView controller");
ObjectListController *objViewController = [vc getListViewController]; // CODE CRASHES HERE. GETS WARNING
[objViewController refreshTable];
} else {
NSLog(@"Delegate: Error, unable to get ListViewController");
}
}