Ios UITableView中节的条件目标视图控制器

Ios UITableView中节的条件目标视图控制器,ios,uitableview,ios6,uistoryboardsegue,Ios,Uitableview,Ios6,Uistoryboardsegue,TableView控制器中的代码 if ([segue.identifier isEqualToString:@"showListFiles"]) { NSIndexPath *ip = [self.tableView indexPathForSelectedRow]; if (ip.section == 0) { NSDictionary *currentBill = [[_response objectForKey:@"facturas_pendiente

TableView控制器中的代码

if ([segue.identifier isEqualToString:@"showListFiles"]) {

    NSIndexPath *ip = [self.tableView indexPathForSelectedRow];

    if (ip.section == 0) {
        NSDictionary *currentBill = [[_response objectForKey:@"facturas_pendientes"] objectAtIndex:ip.row];
        DkBPaymentViewController *pvc = [[DkBPaymentViewController alloc] init];
        pvc = (DkBPaymentViewController *) segue.destinationViewController;
        pvc.setUp = currentBill;
    }
    else if(ip.section == 1){
        DkBBillsFileTableViewController *ftvc = segue.destinationViewController;
        ftvc.filesList = [[[_response objectForKey:@"facturas_pagadas"] objectAtIndex:ip.row] objectForKey:@"archivos_facturas"];
    }

}
-[DkBBillsFileTableViewController setSetUp:]: unrecognized selector sent to instance 0x85a3b00
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DkBBillsFileTableViewController setSetUp:]: unrecognized selector sent to instance 0x85a3b00'
错误

if ([segue.identifier isEqualToString:@"showListFiles"]) {

    NSIndexPath *ip = [self.tableView indexPathForSelectedRow];

    if (ip.section == 0) {
        NSDictionary *currentBill = [[_response objectForKey:@"facturas_pendientes"] objectAtIndex:ip.row];
        DkBPaymentViewController *pvc = [[DkBPaymentViewController alloc] init];
        pvc = (DkBPaymentViewController *) segue.destinationViewController;
        pvc.setUp = currentBill;
    }
    else if(ip.section == 1){
        DkBBillsFileTableViewController *ftvc = segue.destinationViewController;
        ftvc.filesList = [[[_response objectForKey:@"facturas_pagadas"] objectAtIndex:ip.row] objectForKey:@"archivos_facturas"];
    }

}
-[DkBBillsFileTableViewController setSetUp:]: unrecognized selector sent to instance 0x85a3b00
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DkBBillsFileTableViewController setSetUp:]: unrecognized selector sent to instance 0x85a3b00'
如何根据表的节段(第1节付款/第2节付款)有条件地切换到不同的视图控制器,或者最好的方法是什么

详细信息

DkbPaymentViewController有自己的xib,因为我无法使原型单元指向两个不同的单元

DkBBillsFileTableViewController是我声明的原始序列


提前非常感谢您,我相信在tableview中找到一个好的条件转换方法将使所有人受益。

您可以通过编程实现。在情节提要中,从视图控制器(而不是从单元)绘制两个分段。然后在
中选择RowatineXpath
,执行以下操作:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        [self performSegueWithIdentifier:@"SegueForSection1" sender:indexPath];
    } else if (indexPath.section == 1) {
        [self performSegueWithIdentifier:@"SegueForSection2" sender:indexPath];
    }
}

您应该设置两个不同的单元,每个单元链接到不同的分段(因此它们具有不同的标识符),每个单元指向不同的视图控制器。这将使您的代码变得简单,防止类之间的混淆,并按预期使用分段。

为什么您没有两个单元格和两个分段,指向两个不同的视图控制器?谢谢@wain如果您添加您的答案,我很乐意接受。谢谢您的回答,如果我的情况不同,我相信这会奏效!这正是我要找的!一开始我不小心让它自动完成
并取消了rowatinexpath
,所以要小心