0

This code causes my app to crash on an iPhone 4 and on the simulator but works perfectly fine on a 3GS. Any ideas why this might be?

-(IBAction)startButtonClicked{

 GameViewController *screen = [[GameViewController alloc] initWithNibName:nil bundle:nil];
 screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
 [self presentModalViewController:screen animated:YES];
 [screen release]; 
}
NextRev
  • 1,711
  • 4
  • 22
  • 31
  • 2
    Check the console and see if anything useful is being printed there. My guess is something is amiss in your GameViewController. – Ben Gottlieb Aug 05 '10 at 17:36
  • I get this in the console: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' – NextRev Aug 05 '10 at 17:46
  • Are you using a file path that may not be present on the iPhone 4? Use breakpoints on exceptions and a stack trace to determine what line of code is causing that exception. – Brad Larson Aug 05 '10 at 21:59
  • Hey, did you find an answer for this ? – Alexj17 Feb 08 '11 at 12:38

1 Answers1

0

Have you checked out what's happening in screen's viewWillAppear and viewWillLoad methods? It looks like some issue in your init code there. Where are you opening a URL?

joelm
  • 8,741
  • 1
  • 19
  • 17