Instance Method インスタンスメソッド

URLSession:downloadTask:didFinishDownloadingToURL:

Tells the delegate that a download task has finished downloading. 委任先に、ダウンロードタスクがダウンロードを終わったことを伝えます。

Declaration 宣言

- (void)URLSession:(NSURLSession *)session 
      downloadTask:(NSURLSessionDownloadTask *)downloadTask 
didFinishDownloadingToURL:(NSURL *)location;

Parameters パラメータ

session

The session containing the download task that finished. 終了したダウンロードタスクを含んでいるセッション。

downloadTask

The download task that finished. 終了したダウンロードタスク。

location

A file URL for the temporary file. Because the file is temporary, you must either open the file for reading or move it to a permanent location in your app’s sandbox container directory before returning from this delegate method. 一時ファイルに対するファイルURL。そのファイルが一時的であることから、あなたは読み出すためにそのファイルを開くまたはそれをあなたのアプリの持つサンドボックスコンテナディレクトリの中のある永久的な場所に移動するかどちらかを、この委任先メソッドが返る前にしなければなりません。

If you choose to open the file for reading, you should do the actual reading in another thread to avoid blocking the delegate queue. あなたが読み出すためにファイルを開く方を選ぶならば、あなたは実際の読み出しを別のスレッドで行って、委任先キューが遮断されるのを防ぐべきです。