self.navigationController is nil after adding subview
- by Nnp
here is my productscontroller.h
ProductListViewController *productListViewController;
ProductGridViewController *productGridViewController;
UIButton *flipIndicatorButton;
and i am adding list and gridview as a subview like this in my implementation
ProductListViewController *listController = [[ProductListViewController alloc] initWithNibName:@"ProductListView" bundle:nil];
self.productListViewController = listController;
self.productListViewController.CurrentSale = CurrentSale;
[self.view insertSubview:listController.view atIndex:0];
but in when i tried to push detailview controller from ProductListViewController.m like this
ProductDetailViewController *productDetailViewController = [[ProductDetailViewController alloc] init];
productDetailViewController.productIndexPath = indexPath;
[self.navigationController pushViewController:productDetailViewController animated:YES];
it just does not work, then i check [self.navigationController] , it was nil,
now how to deal with this problem. i am ready to give some more code and detail to make more clear. thanks