I am trying to get an object related to my user object. I've tried numerous methods...
this one gets the user object but I don't get the reputation object.
PFuserProfile = [PFQuery getUserObjectWithId:userObj];
PFuserRep = PFuserProfile[@"reputation"];
this one I have an error on the last line.
PFQuery *query = [PFUser query];
[query whereKey:@"objectId" equalTo:userObj];
[testQuery includeKey:@"reputation"];
NSArray *wtf = [query findObjects];
PFuserProfile = [wtf indexOfObject:0];
I've tried some other methods but not sure the best one, I can't get any of them to work... here's the last one where I get an error in setting the profile.
[query whereKey:@"objectId" equalTo:userObj];
[query includeKey:@"reputation"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if(!error){
PFuserProfile = [objects indexOfObject:objects.firstObject];
}
}];
Thank you.
indexOfObject
are you sure you don't meanobjectAtIndex
? – William George