Xcode:在视图之间切换

时间:2012-05-19 21:26:49

标签: ios view tableview switching

我希望能够在视图之间切换。 我一直在编写一些代码,但它不起作用?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
    AlleRumViewController *allerum = [[AlleRumViewController alloc] initWithNibName:nil bundle:nil];

    if ([[tableData objectAtIndex:indexPath.row] isEqual:@"Alle rum"]) {    
        [self presentModalViewController:allerum animated:YES];
    }
}

你们中的任何人都知道如何切换吗?

1 个答案:

答案 0 :(得分:0)

- (IBAction)goButtonPressed:(UIButton*) source {
YourNewViewController* someNameController = [[YourNewViewController alloc] init];
[self.navigationController pushViewController:someNameController animated:YES];
[someNameController release];
}