【发布时间】:2017-04-28 18:47:53
【问题描述】:
我正在 swift 3 中开发一个迷宫游戏,它可以编译,但是当我运行它时出现 EXC_BAD_INSTRUCTION 错误。我对 swift 比较陌生,所以我不知道如何正确调试它。以下是出现错误的代码:
init(window:SKScene, width:Int, height:Int){
widthOfBoard = width
heightOfBoard = height
for i in 0..<widthOfBoard {
var temp:[cell]!
for j in 0..<heightOfBoard {
let tempCell = cell(x: i, y: j, boardWidth: widthOfBoard, boardHeight: heightOfBoard, screenSize: window.frame)
temp.append(tempCell)
}
cells.append(temp)
}
stackOfCells.append(cells[0][0])
recursiveMaze(currentX: 0, currentY: 0, window: window)
}
我收到了cells.append(temp) 的错误。
我也收到了每个错误 these locations.
【问题讨论】:
标签: ios swift exc-bad-instruction