-
-
Save ggthedev/497ecb3bad016fc70ac2 to your computer and use it in GitHub Desktop.
sample : sendAsynchronousRequest
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
xmlData = [[NSMutableData alloc] init]; | |
NSURL *url = [NSURL URLWithString: | |
@"http://forrums.bignerdranch.com/smartfeed.php?" | |
@"limit=NO_LIMIT&count_limit20&sort_by=standard&" | |
@"feed_type=RSS2.0&feed_style=COMPACT"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
//connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; | |
NSOperationQueue *queue = [[NSOperationQueue alloc]init]; | |
[NSURLConnection sendAsynchronousRequest:request | |
queue:queue | |
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){ | |
if (error) { | |
xmlData = nil; | |
NSLog(@"error:%@", error.localizedDescription); | |
} | |
[xmlData appendData:data]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment