【问题标题】:Pushing data from a UITableViewCell to a UINavigationController将数据从 UITableViewCell 推送到 UINavigationController
【发布时间】:2014-12-10 04:37:38
【问题描述】:

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



}

}

【问题讨论】:

  • 其中有什么问题?你没有得到正确的索引路径?
  • 问题是当我链接到导航视图时,它说不支持推送到导航视图。
  • 可能是您的导航层次结构错误。你已经导航到你的视图控制器并再次推送到导航控制器。最后是你的导航在错误的地方。
  • 您在视图控制器之前有导航控制器,您从中推送到下一个 vc

标签: ios xcode hyperlink push


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2014-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-02
    • 2015-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多