在我的项目中,我有 10 个单元格的 tableView。并且在didSelectRowAtIndexPath所有单元格中都有多个 ViewController (文件)所以,我didSelectRowAtIndexPath看起来像
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row == 0) {
            CallViewController *viewc = [[CallViewController alloc] initWithNibName:@"CallViewController" bundle:nil];
            [self.navigationController pushViewController:viewc animated:YES];
        }else if(indexPath.row == 1) {
            BirthdayViewController *viewc = [[BirthdayViewController alloc] initWithNibName:@"BirthdayViewController" bundle:nil];
            [self.navigationController pushViewController:viewc animated:YES];
        }
所以我不希望这些条件我希望我的代码是干净的