0

我一直在尝试从 tableview 推送 uiwebview 无济于事。这是我现在拥有的代码,每当我单击单元格时,它都会崩溃并向我显示错误。

课程.m

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

[tableView deselectRowAtIndexPath:indexPath animated:YES];

if ([[array objectAtIndex:indexPath.row] isEqual:@"GolfClub"])
{
    Blue *changi = [[Blue alloc] initWithNibName:@"Golf Club" bundle:nil];
    [self.navigationController pushViewController:changi animated:YES];
    [changi release];
}
else if ([[array objectAtIndex:indexPath.row] isEqual:@"ExecutiveGolfCourse"])
{
     ExecutiveGolfCourse *egc = [[ExecutiveGolfCourse alloc] initWithNibName:@"Executive Golf Course" bundle:nil];
    [self.navigationController pushViewController:egc animated:YES];
    [egc release];
}

newsClicked.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:newsClicked animated:YES];
}
4

1 回答 1

1
initWithNibName  is not meant for the title of your ViewController

nib 名称实际上是与该 ViewController 关联的 .xib 文件的名称

于 2013-01-22T18:17:55.450 回答