Created
May 9, 2014 11:06
-
-
Save SiarheiFedartsou/bd55c143974143392960 to your computer and use it in GitHub Desktop.
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
@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