0

keep getting this error for this code I used breakpoints it crashes at

GameSelect *selectGame = [[GameSelect alloc] initWithNibName:nil bundle:nil];

I don't know what's going on i am simply switching from one nib to another nib

- (IBAction)playButtonPressed:(UIButton *)sender {
    GameSelect *selectGame = [[GameSelect alloc] initWithNibName:nil bundle:nil];
    selectGame.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:selectGame animated:YES];
}
Vin
  • 10,517
  • 10
  • 58
  • 71
MindXpert
  • 23
  • 4

3 Answers3

0

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

Diffy
  • 735
  • 1
  • 15
  • 34
0

Try putting your nib file name here: GameSelect *selectGame = [[GameSelect alloc] initWithNibName:@"" bundle:nil];

iOS Developer
  • 1,723
  • 2
  • 16
  • 47
0

Make it as follows,

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

If your nib name is any other name instead of "GameSelect" give "your nib name".

Saranya
  • 1,481
  • 3
  • 14
  • 26