Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Created May 28, 2012 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacksonfdam/2819456 to your computer and use it in GitHub Desktop.
Save jacksonfdam/2819456 to your computer and use it in GitHub Desktop.
Fetching Remote Data
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
NSError *error = nil;
NSURL *url = [NSURL URLWithString:@"http://brandontreb.com/apps/pocket-mud-pro/promo.json"];
NSString *json = [NSString stringWithContentsOfURL:url
encoding:NSASCIIStringEncoding
error:&error];
NSLog(@"\nJSON: %@ \n Error: %@", json, error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment