【问题标题】:UISplitViewController detail replace segue opens as modal?UISplitViewController 细节替换segue以模式打开?
【发布时间】:2015-06-27 23:56:32
【问题描述】:

我的应用程序中有一个UISplitViewController,其中包含一个主视图和一个详细视图。详细视图在发布时只是一个空的UIViewController。一旦用户在主视图中选择UITableViewCell,我想将详细视图更改为所选视图。我为此编写了这个函数:

- (void)cellClicked:(NSIndexPath *)indexPath {
    if (indexPath.row == (self.resultArray.count)) {
        [self addCategory:self];
    } else {
        [self performSegueWithIdentifier:@"showDetail" sender:self];
    }
}

还有这个prepareForSegue函数:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue identifier] isEqualToString:@"showDetail"]) {
        NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow;
        NSString *categoryId = [[self.resultArray objectAtIndex:indexPath.row] objectForKey:@"COL2"];

        CategoriesViewController *controller = (CategoriesViewController *)[segue destinationViewController];
        [controller setFeedId:categoryId];
    }
}

但是,执行此操作时,它会以模态形式打开新视图。这 不是 我想要的。我在这里做错了什么?

【问题讨论】:

    标签: ios objective-c uisplitviewcontroller


    【解决方案1】:

    检查您的故事板 segue 类型定义。

    我相信你有模态,因为假设你必须使用故事板。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-29
      相关资源
      最近更新 更多