Created
June 25, 2014 16:30
-
-
Save jault3/fa6e79f1aeb57be599b7 to your computer and use it in GitHub Desktop.
Query Surveys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CatalyzeQuery *query = [CatalyzeQuery queryWithClassName:@"surveys"]; | |
[query setPageSize:20]; | |
[query setPageNumber:1]; | |
[query retrieveInBackgroundWithBlock:^(NSArray *objects, NSError *error) { | |
if (objects) { | |
_surveys = [NSMutableArray array]; | |
_otherSurveys = [NSMutableArray array]; | |
for (NSDictionary *dict in objects) { | |
if ([[dict valueForKey:@"parentId"] isEqualToString:[[CatalyzeUser currentUser] usersId]]) { | |
[_surveys addObject:dict]; | |
} else { | |
[_otherSurveys addObject:dict]; | |
} | |
} | |
[_tblSurveys reloadData]; | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment