Swift 在场景之间移动导致游戏崩溃,EXC_坏_访问错误

Swift 在场景之间移动导致游戏崩溃,EXC_坏_访问错误,swift,sprite-kit,exc-bad-access,Swift,Sprite Kit,Exc Bad Access,首先我想说的是,我的游戏在场景之间移动的很好(第一次)。它从菜单场景开始,现在只有一个按钮,上面写着玩游戏 let play = UIButton.buttonWithType(UIButtonType.System) as UIButton play.frame = CGRect(x: size.width * 0.5, y: size.height * 0.4, width: 100, height: 100) play.setTitle("PLAY GAME", forSt

首先我想说的是,我的游戏在场景之间移动的很好(第一次)。它从菜单场景开始,现在只有一个按钮,上面写着玩游戏

let play = UIButton.buttonWithType(UIButtonType.System) as UIButton
    play.frame = CGRect(x: size.width * 0.5, y: size.height * 0.4, width: 100, height: 100)
    play.setTitle("PLAY GAME", forState: UIControlState.Normal)
    play.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
    play.addTarget(self, action: "buttonAction:", forControlEvents: UIControlEvents.TouchUpInside)
    self.view?.addSubview(play)

func buttonAction(sender:UIButton!)
{
    var gameScene = GameScene(size: self.frame.size)
    var transition = SKTransition.flipVerticalWithDuration(1.0)
    gameScene.scaleMode = SKSceneScaleMode.AspectFill

    let skView = view as SKView!
    skView.presentScene(gameScene, transition: transition)


    play.removeFromSuperview()

}
此按钮将带您进入游戏的另一个场景。当您丢失时,将调用此函数

    func gameOver(){
    let alert = UIAlertView()
    alert.title = "Game Over"
    alert.message = "Score: " + String(score)
    alert.addButtonWithTitle("Okay")
    alert.show()

    var gameStartScene = GameStartScene(size: self.frame.size)
    var transition = SKTransition.flipVerticalWithDuration(1.0)
    gameStartScene.scaleMode = SKSceneScaleMode.AspectFill

    let skView = view as SKView!
    skView.presentScene(gameStartScene, transition: transition)

}

这会带您回到第一个sceen,但当您再次按下“play game”(玩游戏)按钮第二次时,游戏会因EXC_BAD_访问错误而崩溃。有什么想法吗???

像往常一样,我在发帖后就想出来了。。。我在全球范围内宣布“玩”就像每个人都知道你不应该。。。。