Sunday, 15 August 2010

ios - Retrieve all guildmembers in the same guild as you using Parse -



ios - Retrieve all guildmembers in the same guild as you using Parse -

how retrieve guildmembers in guild using parse?

here code:

pfuser *currentuser = [pfuser currentuser]; pfquery *query = [pfquery querywithclassname:@"user"]; [query wherekey:@"connectedguild" equalto:currentuser[@"connectedguild"]]; [query findobjectsinbackgroundwithblock:^(nsarray *comments, nserror *error) { nslog(@"there %d guildmembers. error:%@", comments.count, error); }];

my log:

there 0 guild members. error:(null)

connectedguild pointer guild class store guilds.

queries of pfuser class must instantiated little differently. seek this:

pfuser *currentuser = [pfuser currentuser]; pfquery *query = [pfuser query]; [query wherekey:@"connectedguild" equalto:currentuser[@"connectedguild"]]; [query findobjectsinbackgroundwithblock:^(nsarray *comments, nserror *error) { nslog(@"there %d guildmembers. error:%@", comments.count, error); }];

for more information, see parse.com website here: https://www.parse.com/questions/get-pfuser-in-pfquery-using-ios-api

ios objective-c parse.com pfquery pfuser

No comments:

Post a Comment