ios - Can't retrieve a picture to swift from parse.com using their documentation -
i have been trying follow parse.com's intruction retrieve picture uploaded (also using documentation). code:
let testobject = pfobject(classname: "testobject") let file = testobject["sampleimage.png"] pffile file.getdatainbackgroundwithblock { (imagedata: nsdata?, error: nserror?) -> void in if error == nil { if let imagedata = imagedata { let image = uiimage(data:imagedata) self.mainimg.image = image print("image retreived")
i getting error:
"anyobject! not convertible 'pffile'"
and sugests include ! in 'as'. however, when do, application runs not retrieve anything.
i realize question posted elsewhere, answer not working me. doing wrong?
let testobject = pfobject(classname: "testobject")
this new empty object isn't backed on server. need set id known value , refresh instance of need run query find object before resulting object contain anything.
Comments
Post a Comment