So when my view controller loads I start sending adBanner requests..
- (void)viewDidLoad{
[super viewDidLoad];
self.canDisplayBannerAds = YES;
}
But I get an error when starting my scene for my game even though I set canDisplayBannerAds to NO... I have commented where the error begins through debugging
- (IBAction)startGame:(id)sender {
NSLog(@"Start Game triggered");
adBanner.hidden = 1;
self.canDisplayBannerAds = NO;
// Configure the view.
// Configure the view after it has been sized for the correct orientation.
skView = (SKView *)self.view;
if (!skView.scene) { // the error happens during this if statement
skView.showsFPS = YES;
skView.showsNodeCount = YES;
// Create and configure the scene.
theScene = [TCAMyScene sceneWithSize:skView.bounds.size];
theScene.scaleMode = SKSceneScaleModeAspectFill;
theScene.delegate = self;
// Present the scene.
[skView presentScene:theScene];
}
}
The error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView scene]: unrecognized selector sent to instance 0x16d252a0'
What is the problem? And how do I resolve this?