Created
September 20, 2012 01:16
-
-
Save piaoapiao/3753408 to your computer and use it in GitHub Desktop.
ASIHttpRequest Quene
This file contains hidden or 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
quene = [[ASINetworkQueue alloc] init]; | |
//quene.delegate = self; | |
ASIHTTPRequest *request =[[ASIHTTPRequest alloc] initWithURL:[[[NSURL alloc] initWithString:@"http://www.baidu.com"]autorelease]]; | |
[request setQueue:quene]; | |
request.delegate = self; | |
ASIHTTPRequest *request2 =[[ASIHTTPRequest alloc] initWithURL:[[[NSURL alloc] initWithString:@"http://www.google.com"]autorelease]]; | |
request2.delegate = self; | |
[quene addOperation:request]; | |
[quene addOperation:request2]; | |
ASIHTTPRequest *request3 =[[ASIHTTPRequest alloc] initWithURL:[[[NSURL alloc] initWithString:@"http://www.yahoo.com/"]autorelease]]; | |
request3.delegate = self; | |
[quene addOperation:request3]; | |
ASIHTTPRequest *request4 =[[ASIHTTPRequest alloc] initWithURL:[[[NSURL alloc] initWithString:@"http://www.163.com/"]autorelease]]; | |
request4.delegate = self; | |
[quene addOperation:request4]; | |
ASIHTTPRequest *request5 =[[ASIHTTPRequest alloc] initWithURL:[[[NSURL alloc] initWithString:@"http://www.qq.com/"]autorelease]]; | |
request5.delegate = self; | |
[quene addOperation:request5]; | |
NSLog(@"finish:%d", [[[ASIHTTPRequest sharedQueue] operations] count]); | |
[quene go]; | |
- (void)requestFinished:(ASIHTTPRequest *)request | |
{ | |
NSString *string = [request responseString]; | |
// NSLog(@"cout:%d", [[[ASIHTTPRequest sharedQueue] operations] count]); | |
NSLog(@"queneNumber:%d", [[quene operations] count]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment