Created
September 24, 2012 04:32
-
-
Save deholic/3774193 to your computer and use it in GitHub Desktop.
UI control in GCD Code
This file contains hidden or 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
[NSURLConnection sendAsynchronousRequest:req | |
queue:[[[NSOperationQueue alloc] init] autorelease] | |
completionHandler:^(NSURLResponse *response, | |
NSData *data, | |
NSError *error) { | |
NSError* err; | |
NSDictionary *respJSON = [NSJSONSerialization JSONObjectWithData:data | |
options:NSJSONReadingMutableContainers | |
error:&err]; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
callback(respJSON); | |
}); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment