我有以下代码:
//start the update
var query2 = PFQuery(className:"\(selectedShow)_schedule")
query2.getObjectInBackgroundWithId(idOfObject) {
(objectSend: PFObject!, error: NSError!) -> Void in
if error != nil {
NSLog("%@", error)
} else {
objectSend["student"] = "test"
objectSend.saveEventually()
println("ran")
}
}
当我尝试运行它时,它给了我错误:
fatal error: unexpectedly found nil while unwrapping an Optional value
并突出显示这一行:
objectSend["student"] = "test"
可能出现什么问题?
答案 0 :(得分:0)
变量未包含可选项。