I have gotten this problem several times in Xcode 6. the thing is that I got a ball running and when he hits a block he dies. he can jump though. but the very first block always crashes. like if I just roll normally like not in the air and hit the first block it just freezes and closes.
It gives me this error:
Thread 1: EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP, subcode=0x0)
Line number 2 and 7 have a green background (counting the space).
This is the error line:
func didBeginContact(contact:SKPhysicsContact) {
died()
}
func died() {
if let scene = GameScene.unarchiveFromFile("GameScene") as? GameScene {
let skView = self.view as SKView
skView.ignoresSiblingOrder = true
scene.size = skView.bounds.size
scene.scaleMode = .AspectFill
skView.presentScene(scene)
}
}