0
我得到一個錯誤:錯誤斯威夫特與方法loadJSONFromBundle
Type 'Dictionary' has no member loadJSONFromBundle.
任何想法有什麼錯呢?
init(filename: String)
{
if let dictionary = Dictionary<String, AnyObject>.loadJSONFromBundle(filename) {
if let tilesArray = dictionary["tiles"] as? [[Int]] {
for (row, rowArray) in enumerate(tilesArray as! [[Int]]) {
let tileRow = NumRows - row - 1
for (column, value) in enumerate(rowArray) {
if value == 1 {
tiles[column, tileRow] = Tile()
}
}
}
}
}
}
沒有'loadJSONFromBundle'這樣的方法。你在哪裏看到這樣的方法記錄? – rmaddy