我有以下方法来执行NSURLRequest,但是当我通过3G连接时经常会失败
NSURLRequest *theRequest =
[NSURLRequest requestWithURL:[NSURL URLWithString:downloadServer]
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:15.0];
theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
timer = [NSTimer scheduledTimerWithTimeInterval:15.0 target:self selector:@selector(downloadsUp) userInfo:nil repeats:NO];
self.downloadStartTime = [NSString stringWithFormat:@"%ld", (long)[[NSDate date] timeIntervalSince1970]];
if (theConnection) {
self.receivedData = [[NSMutableData data] retain];
} else {
}
与WIFI连接,它就像一个魅力,但在3G上它失败了!