每当我尝试将照片上传到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)
}
答案 0 :(得分:0)
原来文件太大了,我需要扩展它。感谢Bjorn提醒我查看堆栈跟踪