Skip to content

Instantly share code, notes, and snippets.

@sstadelman
Created November 5, 2014 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sstadelman/375d1d8ca43de3504239 to your computer and use it in GitHub Desktop.
Save sstadelman/375d1d8ca43de3504239 to your computer and use it in GitHub Desktop.
[offline] filtering entities from the database
-(void)fetchContactsWithCompletion:(void(^)(NSArray *entities))completion {
NSString *resourcePath = @"ContactCollection?$filter=length(company) gt 0 and length(function) gt 0";
[self scheduleRequestForResource:resourcePath withMode:SODataRequestModeRead withEntity:nil withCompletion:^(NSArray *entities, id<SODataRequestExecution> requestExecution, NSError *error) {
if (entities) {
completion(entities);
} else {
NSLog(@"did not get any entities, with error: %@", error);
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment