2010-09-09 58 views
1

我試圖建立我的應用程序和互聯網服務之間的連接,我正在使用asihttprequest,但我遇到了一個小問題。當我使用WiFi時,一切都很好,但是當我關掉它並使用GPRS(EDGE)或3G似乎沒有任何作用時。我應該改變什麼。 下面是我的一些代碼asihttprequest:在iPhone上發佈問題

[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

文件有多大? – Nick 2010-09-09 01:27:34

+0

只是來自imagePickerController的圖像 – alecnash 2010-09-09 01:38:26

回答

3

發現我不得不使用

[ASIHTTPRequest setShouldThrottleBandwidthForWWAN];