【发布时间】:2014-12-11 01:07:23
【问题描述】:
我有一个 UISearchDisplaycontroller,我必须将信息推送到文本字段并需要将其链接到导航视图控制器。
这是错误 -
2014-12-10 20:05:08.775 Contents Concepts Mobile[2785:333301] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
*** First throw call stack:
(0x2311dc1f 0x30b96c8b 0x26663207 0x268d0229 0x26662b43 0x266f2f67 0x267a4c0f 0x26656c4d 0x265d2aab 0x230e43b5 0x230e1a73 0x230e1e7b 0x23030211 0x23030023 0x2a3c00a9 0x2663c1d1 0xf0225 0x31116aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
这是我的代码 -
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {
NSIndexPath *indexPath = nil;
Recipe *recipe = nil;
if (self.searchDisplayController.active) {
indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow];
recipe = [searchResults objectAtIndex:indexPath.row];
} else {
indexPath = [self.tableView indexPathForSelectedRow];
recipe = [recipes objectAtIndex:indexPath.row];
}
RecipeDetailViewController *destViewController = segue.destinationViewController;
destViewController.recipe = recipe;
}
}
【问题讨论】:
-
您是否尝试将导航控制器推送到另一个导航控制器上?
-
不,我正在尝试将表格视图控制器推送到导航视图控制器
-
所以你正在推动一个导航视图控制器? “不支持推送导航控制器”
-
是的,正确。我正在尝试推送导航控制器,但我不知道该怎么做。
-
你不能。就像错误所说的那样,“不支持推送导航控制器。”