parse.com - What does includeKey do ? -
i'm confused pfquery's includekey: method. have instance of class foo containing string property name 'state' , pointer class instance (say bar instance) 'bar'.
when query instances of foo want info on bar instance related too:
let query = pfquery("foo") .wherekey("state", equalto: "active") .includekey("bar")
does fetch bar instance properties ? such can do:
let foo = query.getfirstobject() as! foo // access bar property foo.bar.baz = "yep"
what if foo bar property not pointer object ?
thanks
b.
yes, "includekey" include 'bar' pfobject in query results.
in swift should cast "bar" pfobject in order access properties.
if let bar = foo["bar"] as? pfobject { println(bar["baz"]) }
Comments
Post a Comment