AppDelegate,线程1:信号SIGABRT(11db),没有IB插座

时间:2017-02-12 00:40:41

标签: swift xcode8 appdelegate sigabrt

我一直在研究论坛,这里和youtube上寻求答案,但没有取得成功。我在实现这段代码后发现我遇到了错误。谢谢。这是Xcode 8,swift;这是特定的代码和控制台错误:

func startNewLevel1() {

    let spawn = SKAction.run(spawnBubble)
    let waitToSPawn = SKAction.wait(forDuration: 1)
    let spawnSequence = SKAction.sequence([spawn, waitToSPawn])
    let spawnForever = SKAction.repeatForever(spawnSequence)
    self.run(spawnForever)

}

ibc ++ abi.dylib:以NSException类型的未捕获异常终止 (lldb)

修改

 func spawnBubble(){

    let randomXStart = random(min: gameArea.minX, max: gameArea.maxX)
    let randomYEnd = random(min: gameArea.minY, max: gameArea.maxY)

    let spawnPoint = CGPoint(x: randomXStart, y: randomYEnd)

    bubble.position = spawnPoint
    bubble.zPosition = 1
    if #available(iOS 10.0, *) {
        let scale = SKAction.scale(to: CGSize(width: 600, height: 600), duration: 5.0)
        bubble.run(scale)

    } else {
        // Fallback on earlier versions
    }
    // bubble.run(scale)
    bubble.name = "circle"
    bubble.isUserInteractionEnabled = false

    self.addChild(bubble)

}

0 个答案:

没有答案