objective c - update record against a specific user in user class Parse ios -


i have user class in parse , want update record against specific user in parse.i not know how update it.

pfuser *user= [pfuser user];  [user wherekey:@"username" equalto:@"john"];   user[@"cellno"]=cell.text;  [user saveinbackgroundwithblock:^(bool succeeded, nserror *error) {             if(!error)              {               ............             }          }]; 

but [user wherekey:@"username" equalto:@"john"]; can not work , error found how handle it.

what have done created user instance. opposed querying user class. pfuser either pointing existing or creating 1 in circumstance. common error in community , should have popped on google had researched it. proper way query user class in parse :

pfquery *query = [pfuser query];  

then perform rest of method.

fyi, common issue parse devs think can alter users info. can't security reasons, if trying update else's info in user class won't able unless signed in user current user


Popular posts from this blog