0

不断收到此代码的此错误,我使用了它崩溃的断点

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

3 回答 3

0

your initWithNibName is set to nil. You should put a name for your nib.

于 2012-05-21T03:59:25.333 回答
0

尝试将您的 nib 文件名放在这里: GameSelect *selectGame = [[GameSelect alloc] initWithNibName:@"" bundle:nil];

于 2012-05-21T04:25:31.387 回答
0

制作如下,

- (IBAction)playButtonPressed:(UIButton *)sender 
{
    GameSelect *selectGame = [[GameSelect alloc] initWithNibName:@"GameSelect" bundle:nil];
    selectGame.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:selectGame animated:YES];
}

如果您的笔尖名称是任何其他名称而不是“GameSelect”,请给出“您的笔尖名称”。

于 2012-05-21T04:26:36.737 回答