Friday, 15 June 2012

parse.com - PFUser Query Contraint -



parse.com - PFUser Query Contraint -

this current query:

[pfquery *userquery = [pfuser query]; [userquery wherekey:@"phone" containedin:phones]; [userquery findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (!error) { // find succeeded. self.contactswithapp = objects; [self.tableview reloaddata]; } else { // log details of failure nslog(@"error: %@ %@", error, [error userinfo]); } }];

i searching users according array composed of phone number strings. key 'phone' in user class contains phone number string each user. why not working?

try using instead. assuming class querying in parse called user.

replace line of:

pfquery *userquery = [pfuser query];

with this:

pfquery *userquery = [pfquery querywithclassname:@"_user"];

final code:

pfquery *userquery = [pfquery querywithclassname:@"_user"]; [userquery wherekey:@"phone" containedin:phones]; [userquery findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (!error) { // find succeeded. self.contactswithapp = objects; [self.tableview reloaddata]; } else { // log details of failure nslog(@"error: %@ %@", error, [error userinfo]); } }];

parse.com

No comments:

Post a Comment