Last active
November 5, 2015 00:48
-
-
Save augustjoki/808958e8ab0836394e78 to your computer and use it in GitHub Desktop.
block variables
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
__weak typeof(self) weakSelf = self; | |
AFJSONRequestOperation *operation = | |
[AFJSONRequestOperation JSONRequestOperationWithRequest:request | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
NSDictionary *jsonDict = (NSDictionary *) JSON; | |
// this is the array that stores the JSON response | |
NSArray *csvFiles = [jsonDict objectForKey:@"csv_files"]; | |
[weakSelf doSomethingWithTheArray:csvFiles]; | |
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { | |
NSLog(@"Request Failure Because %@",[error userInfo]); | |
}]; | |
[operation start]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment