Skip to content

Instantly share code, notes, and snippets.

@deholic
Created September 24, 2012 04:32
Show Gist options
  • Save deholic/3774193 to your computer and use it in GitHub Desktop.
Save deholic/3774193 to your computer and use it in GitHub Desktop.
UI control in GCD Code
[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