Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What this means is that it's discouraged to download directly to a file on the filesystem, a convention common to desktop computers, but rarely seen on iOS.</p> <p>The data will not <em>always</em> be stored in RAM, the size of the file will probably far outweigh the amount of RAM available on the device, as it's fairly limited. The response from a <code>NSURLConnection</code> will be stored in the cache; it's still written to disk, but the OS keeps track of it, not your application. Because this is an OS implementation detail, which application developers should not be concerned with, there's no guarantee where this data will be stored, and hence try not to access it directly via the filesystem.</p> <p>You can of course save the data to disk, under your control, once you receive the data from <code>NSURLConnection</code>. To do so, set up your <code>NSURLConnection</code> using <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-BAJEAIEE" rel="nofollow">this guide</a>. The important thing is to set up your <code>NSURLConnectionDelegate</code> correctly. <a href="https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate" rel="nofollow">See this documentation regarding the protocol</a>.</p> <p>The method you're interested in is this one (which is a required method anyway!)</p> <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data </code></pre> <p>Once you have the <code>NSData</code> available to you, you can do as you wish with it. You save save this data to disk, see <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html" rel="nofollow">the documentation on NSData</a> on how to do this.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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