Last active
August 29, 2015 14:16
-
-
Save armadsen/92b90d76e88921a71607 to your computer and use it in GitHub Desktop.
DevMountain Lesson 17 (Submodules, AVFoundation, CocoaPods) copy/paste blocks
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
git submodule add https://github.com/AFNetworking/AFNetworking.git External/AFNetworking | |
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.timeapi.org/utc/now"]]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
operation.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, NSData *responseObject) { | |
NSString *response = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; | |
NSLog(@"response: %@", response); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"error: %@", error); | |
}]; | |
[operation start]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment