Skip to content

Instantly share code, notes, and snippets.

@SiarheiFedartsou
Created May 9, 2014 11:06
Show Gist options
  • Save SiarheiFedartsou/bd55c143974143392960 to your computer and use it in GitHub Desktop.
Save SiarheiFedartsou/bd55c143974143392960 to your computer and use it in GitHub Desktop.
@interface Foo : NSObject
{
NSData* _data;
}
@end
@implementation Foo
- (void) download
{
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tut.by"]];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
_data = data;
}];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment