I have a UIViewController subclass(Say BBB) that inherited from already written custom UIViewController class(Say AAA). The BBB class have a UITableView in it and when the user tap on any cell of the UITableView, I want to push another UIViewController class(Say CCC).
So, I tried to push the CCC controller in BBB's tableView: didSelectRowAtIndexPath:
method.
My code is,
CCC *ccc = [[CCC alloc] init];
[self.navigationController pushViewController:ccc animated:YES];
[ccc release];
Nothing happens when tapping the cell, so I checked the naviagtion controller of class BBB by the following code.
if (self.navigationController == nil)
{
NSLog(@"Navigation controller is nil");
}
The message was printed successfully :) So, I tried to assign some thing to navigation controller and my bad luck, it is a read-only property.
Then I tried to make a local UINavigationController by assigning ccc as it rootviewcontroller and then tried to push that local navigation controller. It throws an exception "Pushing the same view controller instance more than once is not supported".
My questions are,
Is it possible to find where the navigation controller get nil value in AAA class? I did not make navigation controller as nil in my BBB class, and I find whether any statements like "self.navigationController = nil" in class AAA. But nothing is like that.
How can I push the CCC class?
Thanks