【发布时间】: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