ios - parse.com objective-c get PfUser object and related object -


I am trying to get objects related to my user object. I have tried many ways ...

This receives a user object but I do not get the prestige object.

  PFuserProfile = [PFQuery getUserObjectWithId: userObj]; PFuserRep = PFuserProfile [@ "Prestige"];  

This is an error on the last line I have.

  PFQuery * query = [PFUser query]; [Query is where: @ "objectID" equal to: userObj]; [TestQuery includes: @ "reputation"]; NSArray * wtf = [query search object]; PFuserProfile = [wtf index off object: 0];  

I have tried some other methods, but it is not certain that the best one is, I can not get any of them to work ... here is the last one Profile where I get an error in the setting.

  [Where the query is: @ "Object ID" equals: userObj]; [Queries include: @ "reputation"]; [Query findObjectsInBackgroundWithBlock: ^ (NSArray * objects, NSError * error) {if (error!) {PFuserProfile = [objects indexOf object: Objects. FirstObject]; }}];  

Thanks.

Make sure that when you use a dictionary object: objectAtIndex: < / P>

So you have to update your code to

  PFQuery * query = [PFUser query]; [Query is where: @ "objectID" equal to: userObj]; [TestQuery includes: @ "reputation"]; NSArray * wtf = [query search object]; PFuserProfile = [wtf objectattacked: 0];  

Better yet, because you can get boundary exceptions with objectAtIndex: : You

  PFuserProfile = [wtf FirstObject];  

This query will not return your object.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -