ios - 'PFUser' does not have a member named 'subscript' -


this question has answer here:

i don't have enough reputation post images, i'm using parse signup , shows me 'pfuser' not have member named 'subscript' error

please check code below

var user = pfuser()     user.username = usernametextfield.text     user.email = emailtextfield.text     user.password = passwordtextfield.text      let imagedata = uiimagepngrepresentation(self.profileimage.image)     let imagefile = pffile(name: "profilephoto.png", data: imagedata)     user["photo"] = imagefile -> [error in line]       user.signupinbackgroundwithblock { (succeeded, error) -> void in          if error == nil {             println("signup successful")          }         else {             println("signup failed")         }       } 

it means cannot access property image subscript. instead of user["photo"] try user.photo


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -