这是我的 productscontroller.h
ProductListViewController *productListViewController;
ProductGridViewController *productGridViewController;
UIButton *flipIndicatorButton;
我在我的实现中添加列表和网格视图作为这样的子视图
ProductListViewController *listController = [[ProductListViewController alloc] initWithNibName:@"ProductListView" bundle:nil];
self.productListViewController = listController;
self.productListViewController.CurrentSale = CurrentSale;
[self.view insertSubview:listController.view atIndex:0];
但是当我尝试像这样从 ProductListViewController.m 推送 detailview 控制器时
ProductDetailViewController *productDetailViewController = [[ProductDetailViewController alloc] init];
productDetailViewController.productIndexPath = indexPath;
[self.navigationController pushViewController:productDetailViewController animated:YES];
它只是不起作用,然后我检查 [self.navigationController] ,它是 nil,现在如何处理这个问题。我准备提供更多代码和细节以更清楚。谢谢