应用程序在此方法上不断崩溃 - 尝试简单地将 Parse 对象固定到本地数据存储,如文档Parse docs中所述:
func saveToBackground(title:String, description:String, coords:CLLocationCoordinate2D, image:UIImage, objectId:String, dateFound:String){
let imageData = image.jpeg(.low)
let imageFile = PFFile(name: "image.png", data: imageData!)
let foundObject = PFObject(className: "FoundObjects")
foundObject["title"] = title
foundObject["description"] = description
foundObject["coordinates"] = coords
foundObject["image"] = imageFile
foundObject["objectId"] = objectId
foundObject["dateFound"] = dateFound
foundObject.pinInBackground()
}
错误:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“PFObject 值可能没有类:NSConcreteValue”
有什么想法吗?