表格详细信息披露iOS

时间:2012-03-11 19:55:21

标签: iphone ios uitableview

我有一个表格视图,每行都有标题。

现在我需要当我点击该行时它应该带我到下一个视图(详细视图)。

我已将行和新视图与segue“Information Detail Segue”相关联。

现在这里是代码:

if ([segue.identifier isEqualToString:@"Information Detail Segue"]) {

    InformationDetailTVC *informationdetailTVC = segue.destinationViewController;
    informationdetailTVC.managedObjectContext = self.managedObjectContext;
    informationdetailTVC.delegate = self;
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    self.selectedInformation = [self.fetchedResultsController objectAtIndexPath:indexPath];
    NSLog(@"Passing selected role (%@) to RoleDetailTVC", self.selectedInformation.title);
    informationdetailTVC.information = self.selectedInformation;
}

但是当我在运行并点击单元格时,控件不会进入此循环。实际上,当我单击单元格时,它只是变为蓝色,并且不会加载新视图。

任何人都可以告诉我我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

尝试实施:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

不要忘记设置您的委托和数据源(通常在xib文件上)

相关问题