2014-12-11 101 views
0

我有一个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; 



} 
} 
+1

您是否试图将导航控制器推到另一个导航控制器上? – AdamPro13 2014-12-11 01:08:12

+0

不,我正在尝试将表格视图控制器推送到导航视图控制器 – 2014-12-11 01:10:24

+0

因此,您要推送导航视图控制器? “不支持导航控制器” – 2014-12-11 01:11:50

回答

0

你也可以上传你的故事板设置为好。看起来你有两个不同意见之间的链接问题。导致错误消息表示您试图推动导航控制器而不是视图控制器。

+0

我在这里发布了我的故事板图片。 http://s1302.photobucket.com/user/mattsuff1/media/ScreenShot2014-12-10at81933PM_zpsa29e0116.png.html – 2014-12-11 01:22:56

+0

我使用的表格视图控制器位于角落的右侧。他们是3个控制器。 – 2014-12-11 01:25:47

+0

您无法将导航控制器推到另一个导航控制器。您只能将viewcontroller推送到导航控制器。 – PrimaryChicken 2014-12-11 01:27:46