每当我尝试拍照上传到 Parse 作为用户的个人资料图片时,我的应用程序就会不断崩溃。花了几个小时在网上找,但无法弄清楚。请帮忙
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
let pickedImage: UIImage = info[UIImagePickerControllerOriginalImage] as! UIImage
let imageData = UIImagePNGRepresentation(pickedImage)
let imageFile:PFFile = PFFile(data: imageData)
PFUser.currentUser()!.setObject(imageFile, forKey: "profile_picture")
PFUser.currentUser()!.saveInBackground()
picker.dismissViewControllerAnimated(true, completion: nil)
}