문제

I am having an error with my code, I am having an issue with my code, So I have a settings bundle that defines whether SpriteKit shows the Nodes and FPS in the scene and this code works, it just when I run it in the simulator it gets an problem at the last line and says it has a problem with the view controller running theScene and doesnt load my scene but when I am in the simulator I can click on the app and it runs all fine, I have no idea what the problem is?

And also, is there a way to reset whether the skView shows the FPS count, when I go back into the app from the homescreen (while the app is running)?

- (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)
도움이 되었습니까?

해결책

That is not an error, Xcode hit a breakpoint that you set.

A breakpoint stops execution of the running program before the highlighted line is executed, allowing you to see the values of variables and step through code to debug. See: https://developer.apple.com/library/ios/recipes/xcode_help-source_editor/Creating,Disabling,andDeletingBreakpoints/Creating,Disabling,andDeletingBreakpoints.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top