Created
November 19, 2012 19:21
-
-
Save fantactuka/4113044 to your computer and use it in GitHub Desktop.
Stupid Objective C hashes
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
NSMutableDictionary *requestConfig = [NSMutableDictionary dictionaryWithObjectsAndKeys: | |
@"GET", @"method", | |
@"/", @"path", | |
[[NSMutableDictionary alloc] init], @"params", | |
^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"[Request] Success: %@", responseObject); | |
}, @"success", | |
^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"[Request] Failure: %@", error); | |
}, @"failure", | |
nil]; | |
// Compared with way more readable | |
NSMutableDictionary *requestConfig = [NSMutableDictionary dictionaryWithObjectsAndKeys: | |
@"method", @"GET", | |
@"path", @"/", | |
@"params", [[NSMutableDictionary alloc] init], | |
@"success", ^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"[Request] Success: %@", responseObject); | |
}, | |
@"failure", ^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"[Request] Failure: %@", error); | |
}, | |
nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment