ASIHTTPRequest を使用してデータを取得していますが、リクエストをキャンセルするにはどうすればよいですか?? 私はちょうどこのようにコードを行います..
-(void) serachData{
NSURL *url= [NSURL URLWithString:self.safestring];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setTimeOutSeconds:7200];
[request setDelegate:self];
[request startAsynchronous];
}
- (NSMutableDictionary *)requestFinished:(ASIHTTPRequest *)request
{
NSLog(@"requestFinished");
NSString *responseString = [request responseString];
SBJsonParser *json = [[SBJsonParser alloc] init];
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects[jsonobjectWithString:responseString], nil];
NSLog(@"array %@",array);
}
- (void)requestFailed:(ASIHTTPRequest *)request{
NSLog(@"requestFailed");
}
//キャンセル ボタンを押すと (requestFinished /requestFailed メソッドが処理中の場合)、ASIHTTPRequest は失敗し、メソッドを終了します Stop /abort! どうやってこれを行うのですか??
-(IBAction)CancleREquest:(id)sender{
NSLog(@"CancleREquest");
}