Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're downloading any data over a network connection, I would suggest using <a href="http://allseeing-i.com/ASIHTTPRequest/" rel="nofollow">ASIHttpRequest</a>. This will allow you to download files asynchronously, meaning your interface doesn't freeze during the download process.</p> <p>If you use <code>ASIHttpRequest</code>, you can also set the <code>didFinishSelector</code>. By doing this, you can control which method is called when a specific URL has finished loading.</p> <p>Have a look at this:</p> <pre><code>NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; [request setDidFinishSelector:@selector(requestDone:)]; </code></pre> <p>Then:</p> <pre><code>- (void)requestDone:(ASIHTTPRequest *)request { // Use when fetching text data NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; // If you want, you can get the url of the request like this NSURL *url = [request url]; } </code></pre> <p>As for the second part of your question, if the <code>requestDone:</code> method has not been called, you know the download has not completed.</p> <p>If you want to do something more complicated with multiple downloads, <code>ASIHttpRequest</code> offers queue functionality too. Take a look <a href="http://allseeing-i.com/ASIHTTPRequest/How-to-use" rel="nofollow">here</a>.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      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