我正在尝试在我的应用和互联网服务之间建立连接,我正在使用asihttprequest,但我遇到了一个小问题。当我在WiFi上时,一切都很好,但当我关闭它并使用GPRS(EDGE)或3G似乎没有任何作用。我应该改变什么。 这是我的一些代码
[self setRequest:[ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"example.url.php"]]];
[request setPostValue:textString forKey:@"mytext"];
[request setData:imageData withFileName:theFinal andContentType:@"image/png" forKey:@"userfile"];
[request setPostValue:textString2 forKey:@"description"];
[request setPostValue:latitude forKey:@"latitude"];
[request setPostValue:longitude forKey:@"longitude"];
[request setPostValue:finalIdString forKey:@"city_id"];
[request setTimeOutSeconds:60];
[request setUploadProgressDelegate:progressIndicator];
[request setDelegate:self];
[request setDidFailSelector:@selector(uploadFailed:)];
[request setDidFinishSelector:@selector(uploadFinished:)];
[request startAsynchronous];
答案 0 :(得分:3)
发现我必须使用
[ASIHTTPRequest setShouldThrottleBandwidthForWWAN];