Hey all,
I have a basic question that's driving me crazy.
I have a class inheriting from UITableViewController. It is the root controller in my navigation controller. I have another class that implements the UITableViewDelegate and UITableViewDataSource protocols (my delegate).
Basically, in my delegate's tableView:didSelectRowAtIndexPath: method, I want to push a new controller.
When the delegate protocols were simply implemented by the UITableViewController, it was easy:
[self.navigationController pushViewController:nextController animated:YES];
I (obviously) can't do that in the delegate class. How the heck do I refer to the UITableViewController subclass to get access to the navigationController? It's driving me nuts!
Basic Flow:
- UITableViewController calls delegate
- delegate runs tableView:didSelectRowAtIndexPath:
- in the delegate's tableView:didSelectRowAtIndexPath:, code needs to push new controller onto navigationController
- delegate does not have reference to navController or the TableViewController to do the push.
- code gives a compiler error if i try to pass into the delegate the tableController or navController via a property. so, i can't give it a reference back to the calling tableViewController