我有一個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;
}
}
您是否試圖將導航控制器推到另一個導航控制器上? – AdamPro13 2014-12-11 01:08:12
不,我正在嘗試將表格視圖控制器推送到導航視圖控制器 – 2014-12-11 01:10:24
因此,您要推送導航視圖控制器? 「不支持導航控制器」 – 2014-12-11 01:11:50