[objective-c]NSURLDownload

NSURLDownload

- (void)startDownloadWithURL:(NSString*)urlstr
{
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlstr]
                                                cachePolicy:NSURLRequestUseProtocolCachePolicy
                                            timeoutInterval:5.0];
    NSURLDownload  *download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
    if (!download) {

    }
}
- (void)download:(NSURLDownload *)download decideDestinationWithSuggestedFilename:(NSString *)filename
{
    NSString *destinationFilename = @"ローカルファイルパス";
    [download setDestination:destinationFilename allowOverwrite:YES];
}
- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response
{

}
- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length
{

}
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
{

}
- (void)downloadDidFinish:(NSURLDownload *)download
{

}