【问题标题】:Xcode: Switching between viewsXcode:在视图之间切换
【发布时间】:2012-05-19 21:26:49
【问题描述】:

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

- (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];
    }
}

你们有谁知道我如何切换?

【问题讨论】:

    标签: ios view tableview switching


    【解决方案1】:
    - (IBAction)goButtonPressed:(UIButton*) source {
    YourNewViewController* someNameController = [[YourNewViewController alloc] init];
    [self.navigationController pushViewController:someNameController animated:YES];
    [someNameController release];
    }
    

    【讨论】:

    • 当然在 TableViewController 的情况下你可以将这段代码写到 didSelectRowAtIndexPath 方法中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多