Skip to content

Instantly share code, notes, and snippets.

@sstadelman
Last active August 29, 2015 14:06
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/2ed88505c006f56d9d94 to your computer and use it in GitHub Desktop.
Save sstadelman/2ed88505c006f56d9d94 to your computer and use it in GitHub Desktop.
fetchTravelAgenciesSampleWithCompletion
-(void)fetchTravelAgenciesSampleWithCompletion:(void(^)(NSArray *entities))completion {
NSString *resourcePath = @"TravelagencyCollection";
SODataRequestParamSingleDefault *myRequest = [[SODataRequestParamSingleDefault alloc] initWithMode:mode resourcePath:resourcePath];
myRequest.payload = entity ? entity : nil;
[self scheduleRequest:myRequest completionHandler:^(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