Skip to content

ldt25290/SimpleAFNetworking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleAFNetworking example

A Simple AFNetworking example

Overview

  • version: 0.1.0

Description

Uses iTunes search to retrieve a list of movies that Bruce Willis has appeared in. see the link for more info.

####The View Controller

alt screenshot

###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];

Requirements

  • Xcode 5

Compatibility

  • Xcode 5

Installation Instructions

Download, unzip, open in Xcode

Uninstallation

delete the directory

Support

No Support.

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Developer

@iggym

License

OSL - Open Software Licence 3.0

Copyright

(c) 2013 iggym

About

Simple AF Networking example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published