【发布时间】:2012-04-10 10:09:32
【问题描述】:
我在我的项目中使用 ASIHTTPRequest,但我遇到了 iPhone 3G 的问题。 我发送请求到:
NSURL* pageURL = [NSURL URLWithString:@"https://accounts.google.com/ServiceLogin?service=sj"];
loginPageRequest = [[ASIHTTPRequest alloc] initWithURL:pageURL];
[loginPageRequest setTimeOutSeconds:30];
[loginPageRequest setDelegate:self];
[loginPageRequest startAsynchronous];
在其他设备上我得到了回应:
- (void)requestFinished:(ASIHTTPRequest *)request
在 iPhone 3G 中我得到了很多次:
- (void)requestFailed:(ASIHTTPRequest *)request
错误信息:The request timed out
我将请求超时设置为 30 秒。
知道为什么会这样吗?
【问题讨论】:
-
可能是你的ASIHTTPRequest在3G下需要更多的时间,把30改成90试试吧
标签: iphone objective-c asihttprequest