【问题标题】:Application tried to present a nil modal view controller error应用程序试图呈现一个零模式视图控制器错误
【发布时间】:2013-01-06 01:52:42
【问题描述】:

我一直试图从 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];
}

【问题讨论】:

    标签: iphone xcode uitableview uiwebview


    【解决方案1】:
    initWithNibName  is not meant for the title of your ViewController
    

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

    【讨论】:

      猜你喜欢
      • 2013-03-13
      • 2016-12-22
      • 1970-01-01
      • 2018-08-24
      • 2022-01-11
      • 2013-12-18
      • 1970-01-01
      • 1970-01-01
      • 2011-12-25
      相关资源
      最近更新 更多