我想做以下事情:我正在制作一个 ASIFormDataRequest 并且我想在它完成后调用一个新的:
所以我的代码看起来像这样:
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:url];
[request setDelegate:self];
[request setPostValue:mail forKey:@"email"];
[request setPostValue:cod forKey:@"code"];
[request setPostValue:tab forKey:@"table"];
[request setPostValue:name forKey:@"name"];
[request startAsynchronous];
- (void)requestFinished:(ASIHTTPRequest *)request
{
//request 1 is done, invoke request 2
ASIFormDataRequest *request_2=[ASIFormDataRequest requestWithURL:url];
[request_2 setDelegate:self];
[request_2 setPostValue:other_data forKey:@"info"];
[request_2 setPostValue:phone forKey:@"phone"];
[request startAsynchronous];
}
而且我不知道我必须在 requestFinished 中放置什么以便确定两个请求中的哪一个已经完成?或者是否有其他方法可以这样做?