Last active
August 29, 2015 14:06
-
-
Save sstadelman/2ed88505c006f56d9d94 to your computer and use it in GitHub Desktop.
fetchTravelAgenciesSampleWithCompletion
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
-(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