我有以下方法来执行 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它失败了!