0

我正在使用一个NSObject名为的类作为我的类MyClass中我的 tableView 的数据源和委托。当在 MasterView DetailViewController DetailViewController MyClass`中选择一个单元格时,它没有继承 NavigationController?UIViewControllerMasterViewit pushes another ViewController called. How do I pushfrom

我失败的尝试:

//This will push the view but I cant return afterward.
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.navigationController pushViewController:detailViewController animated:YES];

//This just does nothing
masterView = [[MasterViewController alloc] init];
[masterView.navigationController pushViewController:detailViewController animated:YES];
4

1 回答 1

0

MyClass 可以对 MasterView (UIViewController) 进行弱引用,然后代码 [masterView.navigationController pushViewController:detailViewController animated:YES]; 应该管用。

于 2013-06-20T05:11:11.613 回答