parse.com - Optional Types With Parse and Swift -
if var findpublisher:pfquery = pfuser.query(){ findpublisher.wherekey("objectid", equalto:quote.objectforkey("publisher").objectid)//error here }
i getting error value of optional type 'any object'? not unwrapped. don't know have done incorrectly. beginner please bear me:)
this place give each quote pointer user object, , publisher of quote without query. if want way, do:
let query = pfuser.query()! query.wherekey("objectid", equalto: (quote["publisher"] as! string)) // can unwrap long sure quote not nil, , publisher set. query.getfirstobjectinbackgroundwithblock({ (user: pfobject?, error: nserror?) in // check errors , use object })
this way of doing creates parse security issues, app's id , key can full user list.
Comments
Post a Comment