UITableView中点击不同Cell跳转到不同的View

来源:互联网 发布:企业社会责任数据 编辑:程序博客网 时间:2024/06/08 13:28
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {    if (indexPath.row % 2 == 0) {        ViewControllerOne *oneController = [[self storyboard]instantiateViewControllerWithIdentifier:@"ViewOne"];        [[self navigationController] pushViewController:oneController animated:YES];    } else {        ViewControllerTwo *twoController = [[self storyboard]instantiateViewControllerWithIdentifier:@"ViewTwo"];        [[self navigationController] pushViewController:twoController animated:YES];    }}

0 0