self.navigationController is nil after adding subview
Posted
by Nnp
on Stack Overflow
See other posts from Stack Overflow
or by Nnp
Published on 2009-12-31T02:19:31Z
Indexed on
2010/03/12
14:47 UTC
Read the original article
Hit count: 831
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
© Stack Overflow or respective owner