Created
November 11, 2014 20:46
-
-
Save sanketfirodiya/67684baaab45b164d66c to your computer and use it in GitHub Desktop.
NSURLSession Sample
This file contains hidden or 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
NSURLSession *session = [NSURLSession sharedSession]; | |
NSURLSessionDataTask *dataTask = [session dataTaskWithURL:[NSURL URLWithString:@"https://itunes.apple.com/search?term=apple&media=software"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { | |
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; | |
NSLog(@"%@", json); | |
}]; | |
[dataTask resume]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment