Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将数据从UITableViewCell推送到UINavigationController_Ios_Xcode_Hyperlink_Push - Fatal编程技术网

Ios 将数据从UITableViewCell推送到UINavigationController

Ios 将数据从UITableViewCell推送到UINavigationController,ios,xcode,hyperlink,push,Ios,Xcode,Hyperlink,Push,我有一个UISearchDisplaycontroller,我必须将信息推送到文本字段,并需要将其链接到导航视图控制器。 这是我的代码- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"showRecipeDetail"]) { NSIndexPath *indexPath = nil; Recipe *re

我有一个UISearchDisplaycontroller,我必须将信息推送到文本字段,并需要将其链接到导航视图控制器。

这是我的代码-

- (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;



}

}

您的UINavigationController继承人权限错误或放置错误

Plz参考


它有什么问题?您没有获得正确的indexpath?问题是当我链接到导航视图时,它表示不支持推送到导航视图。可能是您的导航层次结构错误。您已经导航到您的viewcontroller,并再次按下导航控制器。最后一个问题是您的导航位置错误。您在viewcontroller之前有导航控制器,您要从它推到下一个vc