0

My app keeps crashing whenever I try to take a picture to upload to Parse as the user's profile picture. Spent hours looking online, but can't figure it out. Please help

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)
}

1 Answers1

0

Turns out the file was too big and I needed to scale it. Thanks Bjorn for reminding me to look at the stack trace