所以当我的视图控制器加载时,我开始发送广告横幅请求..
- (void)viewDidLoad{
[super viewDidLoad];
self.canDisplayBannerAds = YES;
}
但是,即使我将 canDisplayBannerAds 设置为 NO,在为我的游戏启动场景时也会出现错误...我已经通过调试评论了错误开始的位置
- (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];
}
}
错误:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIView 场景]:无法识别的选择器发送到实例 0x16d252a0”
问题是什么?我该如何解决这个问题?