应用程序试图呈现零模态视图控制器错误

时间:2013-01-22 18:11:14

标签: iphone xcode uitableview uiwebview

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

Courses.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];
}

1 个答案:

答案 0 :(得分:1)

initWithNibName  is not meant for the title of your ViewController

nib name实际上是与该ViewController

关联的.xib文件的名称