0
votes

Sorry I'm a beginner at objective C and coding in general. I have a class name called "user" and a column called sneezes which is a number. Im trying to get the current users number of sneezes in a PFQuery but i cant seem to find out how and don't know where to start. I did look at and tried the documentation of PfQuery and the tutorials. I think i need to use whereKey: equalTo: ?

1
if you are using PFUser, then you need not do PFQuery. You can just get it by handsome guy's code. - Abin George

1 Answers

0
votes
int sneezes = [[PFUser currentUser][@"sneezes"] intValue];

When logged in, [PFUser currentUser] always gives you the user object. Adding [@"sneezes"] is the literal way of doing this:

int sneezes = [[[PFUser currentUser] objectForKey:@"sneezes"] intValue];