不断为此代码收到此错误 我在
处使用了断点GameSelect *selectGame = [[GameSelect alloc] initWithNibName:nil bundle:nil];
我不知道发生了什么事 我只是从一个笔尖切换到另一个笔尖
- (IBAction)playButtonPressed:(UIButton *)sender {
GameSelect *selectGame = [[GameSelect alloc] initWithNibName:nil bundle:nil];
selectGame.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:selectGame animated:YES];
}
答案 0 :(得分:0)
您的initWithNibName设置为nil。你应该为你的笔尖命名。
答案 1 :(得分:0)
尝试将你的nib文件名放在这里:GameSelect * selectGame = [[GameSelect alloc] initWithNibName:@“”bundle:nil];
答案 2 :(得分:0)
如下所示,
- (IBAction)playButtonPressed:(UIButton *)sender
{
GameSelect *selectGame = [[GameSelect alloc] initWithNibName:@"GameSelect" bundle:nil];
selectGame.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:selectGame animated:YES];
}
如果您的笔尖名称是任何其他名称而不是“GameSelect”,请提供“您的笔尖名称”。