IOS GameOver screen not showing

We have a bug with our iOS game. The game screen (containing the score) does not appear after losing the game, as it simply freezes. Can anyone suggest what the problem might be and how can we fix it?

We are currently testing and we are not sure if this is due to the code or test settings? But so far Xcode doesn't show any errors.

Thank you for your help.

+3


source to share


1 answer


Open a view from a regular class:

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:storyBoardName bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:StoryboardID];
[self presentViewController:viewController animated:NO completion:nil];

      

Edit these lines: storyBoardName = The name of your storyboard.
storyBoardID = The StoryBoardID of your ViewController.

Open View from AppDelegate

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:storyBoardName bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:storyBoardID];
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];

      



Edit these lines: storyBoardName = The name of your storyboard.
storyBoardID = The StoryBoardID of your ViewController.

Other information

How do I get storyBoardName?
If your StoryBoard is called Main.storyboard

Main, that's the name.
If your StoryBoard is called MyName.storyboard

MyName, this is the title

How do I set the StoryBoardID?
Select your ViewController. Your view should now be highlighted in blue. Go to the Identity inspector and under the personnel you will find the StoryBoardID. Install it the way you like it.


If it still doesn't work when you use this code, you entered the wrong variables or there is an unknown error.

0


source







All Articles