我希望访问ASIHTTPRequest的实例
{
ASIHTTPRequest *myRequest;
}
@property (nonatomic, retain) ASIHTTPRequest *myRequest;
//-----------------------------------
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:requestURL]];
[request setTag:selectTag];
myRequest=request;
[request startAsynchronous];
如果我强制请求停止工作
我使用了代码
if (myRequest!=nil)
{
[myRequest cancel];
}
但myRequest始终返回0x00000000
欢迎任何评论
答案 0 :(得分:0)
我认为你需要测试请求是否已经完成或取消。
if (myRequest && ![myRequest isCancelled] && ![_request isFinished])
{
[myRequest cancel];
myRequest = nil;
}
答案 1 :(得分:-2)
试试这个为我工作
NSURL *url = [NSURL URLWithString:@"Your Url"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setRequestMethod:@"POST"];
[request setPostValue:email forKey:@"email_id"];
[request setPostValue:pasw forKey:@"user_password"];
[request setDelegate:self];
[request startAsynchronous];