A Simple AFNetworking example
- version: 0.1.0
Uses iTunes search to retrieve a list of movies that Bruce Willis has appeared in. see the link for more info.
####The View Controller
###Interesting Code Snippets
#####Set up the URL and Request
NSURL *url = [[NSURL alloc] initWithString:@"https://itunes.apple.com/search?term=bruce+willis&entity=movie"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
#####Fetch and parse JSON data in the background
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
self.results = [JSON objectForKey:@"results"];
[self.activityIndicatorView stopAnimating];
[self.tableView setHidden:NO];
[self.tableView reloadData];
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
}];
[operation start];
- Xcode 5
- Xcode 5
Download, unzip, open in Xcode
delete the directory
No Support.
Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.
@iggym
OSL - Open Software Licence 3.0
(c) 2013 iggym