0

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 では失敗します。

4

0 に答える 0