0
我有我的代码错误,我有我的代码的问题,所以我有一个设置包,它定义是否SpriteKit显示场景中的节点和FPS和此代码的作品,它只是当我在模拟器中运行它,它在最后一行出现问题,并说它有一个运行theScene
的视图控制器的问题,并没有加载我的场景,但是当我在模拟器中时,我可以点击该应用程序,它运行良好,我不知道问题是什么?SpriteKit布尔错误
还有,当我从主屏幕回到应用程序(应用程序运行时)时,是否有方法可以重置skView
是否显示FPS计数?
- (void)startScene
{
SKView *skView = (SKView *)self.view;
if(!skView.scene)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL statsForNerds = [defaults boolForKey:@"myKeyName"];
if (statsForNerds)
{
skView.showsFPS = YES;
skView.showsNodeCount = YES;
}
else
{
skView.showsFPS = NO;
skView.showsNodeCount = NO;
}
MyScene *theScene = [MyScene sceneWithSize:skView.bounds.size];
theScene.scaleMode = SKSceneScaleModeAspectFill;
// Present the scene.
[skView presentScene:theScene];
}
} //Here's the problem line (According to Xcode)
好的,但是错误信息是什么? xcode抱怨什么? – LearnCocos2D
@ LearnCocos2D以下是错误http://i.imgur.com/vHSJCiN.png – user3089637