Note that there are some explanatory texts on larger screens.

plurals
  1. PONSURLConnection very long downloading
    primarykey
    data
    text
    <p>I'm facing problem with downloading 5 MB file, it taking more then 2 minutes on iPhone 5 with iOS 6.1. </p> <p>Using iPhone 4S with same iOS version it taking only 10 seconds, both are using WiFi. </p> <p>I have tried different cache Policy and timeout Interval of NSURLRequest, it changed nothing, it's still taking long time. Download is over HTTP.</p> <p>I'm using <strong>NSURLConnection</strong> class, before downloading this "big" file I'm downloading two others. </p> <p>Don't know what else can be important,to reduce the time.</p> <p>Thanks in advance.</p> <p>Code:</p> <pre><code>@interface MyClass : NSObject &lt;NSURLConnectionDelegate&gt; { @private id delegate; NSURLConnection *connection; NSMutableData* responseData; //... } #import "MyClass.h" @implementation MyClass -(void)getObj1:(id)delegateObj { delegate = delegateObj; NSString *url = @"..."; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:120.0]; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if(connection) { responseData = [NSMutableData data]; } } -(void)getObj2:(*String)somesString { NSString *url = @"..."; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:120.0]; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if(connection) { responseData = [NSMutableData data]; } } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { //.... } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { if(firstRequest) { //save data from first request and set responseData clear [self getObj2:@"..."]; } } </code></pre> <p>and others without anything special, I hope this will be enough</p> <p>I have found this post <a href="https://devforums.apple.com/message/754875#754875" rel="noreferrer">https://devforums.apple.com/message/754875#754875</a> but still doesn't work fine for me. However now I better understand this strange situation.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload