Fixing example in README to use NSOperationQueue instead of just calling -start on an operation

This commit is contained in:
Mattt Thompson 2011-08-22 07:06:36 -05:00
parent 11cee66b6a
commit b54dd95d2e

View file

@ -19,7 +19,7 @@ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http
AFJSONRequestOperation *operation = [AFJSONRequestOperation operationWithRequest:request success:^(id JSON) { AFJSONRequestOperation *operation = [AFJSONRequestOperation operationWithRequest:request success:^(id JSON) {
NSLog(@"Name: %@ %@", [JSON valueForKeyPath:@"first_name"], [JSON valueForKeyPath:@"last_name"]); NSLog(@"Name: %@ %@", [JSON valueForKeyPath:@"first_name"], [JSON valueForKeyPath:@"last_name"]);
}]; }];
[operation start]; [[NSOperationQueue mainQueue] addOperation:operation];
``` ```
### Image Request ### Image Request