From my gameScene, I am using it to disconnect. But in essence, it is to move viewController.
GameScene
@implementation
gameController = [[GameViewController alloc] init];
-(void)disconnect {
[gameController disconnectAction];
}
@interface
GameViewController *gameController;
GameViewController
@interface
#import "ConnectionsViewController.h"
-(void)disconnectAction;
@implementation
-(void)disconnectAction {
ConnectionsViewController *game = [self.storyboard instantiateViewControllerWithIdentifier:@"ConnectionsViewController"];
[self presentViewController:game animated:YES completion:nil];
}
However, this returns the error of trying to modal a nil viewcontroller
. And yes, the storyboard ID is correct. I have also tried
UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
However, this returns a nil storyboard exception.