I have a UIViewController in which I am adding a subclass of a UITableView as a subview.
e.g.
@interface ViewController : UIViewController
@interface ItemList : UITableView
in ViewController viewDidLoad I create a ItemList (itemList) object and add it to the view of the viewcontroller
- (void)viewDidLoad {
...
[self.view addSubview:itemList];
}
in the didSelectRowAtIndexPath of ItemList which is a UITableView I do not have access to the navigation controller so how do I push another viewcontroller on to the navigationcontroller?
@implementation ItemList
{
...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.navigationController pushViewController:newViewControllerobject animated:YES];
}
}
Create a property eg :
ViewController *mydelegatein itemList class.when you add the itemList in ViewController’s
viewDidLoadadd the followingMoving ahead..on did select