2015-06-10 6 views

ответ

1

Пожалуйста, проверьте ниже код, добавьте фотографии полей в таблицу пользователя с parse.com

var user = PFUser() 

    let imageData = UIImageJPEGRepresentation(userDetails.getPhoto(), 0.05) 
    let imageFile = PFFile(name:"image.jpg", data:imageData) 
    imageFile.save() 

    user.username = usrEntered 
    user.password = pwdEntered 
    user.email = emlEntered 

    user.setObject(imageFile, forKey: "photo") 

    user.signUpInBackgroundWithBlock { 
     (succeeded: Bool!, error: NSError!) -> Void in 
      if error == nil { 
       // Hooray! Let them use the app now. 
       self.messageLabel.text = "User Signed Up"; 
      } else { 
       // Show the errorString somewhere and let the user try again. 
      } 
    }