我收到错误Swift动态类型转换在运行时失败。解析表中的选项是一个数组
if let objects = objects as? [PFObject] {
for object in objects {
println(object.objectId)
let pf = object as PFObject
let name = pf["Question"] as String
// let data1 = pf["Options"] as? NSData
let jsonData: NSData = pf["Options"] as NSData!
let json = JSON(data: jsonData)
self.myArray = json.arrayObject as Array<String>
println(name)
self.question.text = name
// println(answers1)
}
}
答案 0 :(得分:0)
尝试在for循环中进行投射
for object in objects as [PFObject]
然后你不必在其中再次施放它。