NSObject(XGFileDownloadDelegate)

Extends Class:
Declared In:

Overview

The XGFileDownloadDelegate delegate is used to receive the content data and report the progress of the download.



Methods

-fileDownload:decideDestinationWithSuggestedPath:

This method is called when enough information has been loaded to decide a destination for the downloaded file.

-fileDownload:didCreateDestination:

This method is called if the download creates a downloaded file.

-fileDownload:didFailWithError:

This method is called when the download has failed.

-fileDownload:didReceiveAttributes:

This method is called when the download has loaded the attributes of the file.

-fileDownload:didReceiveData:

This method is called when the download has loaded data.

-fileDownloadDidBegin:

This method is called immediately after the download has started.

-fileDownloadDidFinish:

This method is called when the download has finished downloading.


fileDownload:decideDestinationWithSuggestedPath:


This method is called when enough information has been loaded to decide a destination for the downloaded file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        decideDestinationWithSuggestedPath:(NSString *)path; 
Parameters
fileDownload

The download that requests the download path.

filename

The suggested relative path for deciding the path of the downloaded file.

Discussion

Once the delegate has decided a path, it should call setDestination:allowOverwrite:. This delegate method will not be called if setDestination:allowOverwrite: has already been called. If the destination is not set, or if the destination is set to nil, no file will be saved to disk.


fileDownload:didCreateDestination:


This method is called if the download creates a downloaded file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didCreateDestination:(NSString *)destination; 
Parameters
fileDownload

The download that created the downloaded file.

path

The path of the downloaded file.


fileDownload:didFailWithError:


This method is called when the download has failed.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didFailWithError:(NSError *)error; 
Parameters
fileDownload

The download that ended in error.

error

The error caused the download to fail.

Discussion

This method is called when the download encounters a network or file I/O related error. This method or downloadDidFinish: will only be called once.


fileDownload:didReceiveAttributes:


This method is called when the download has loaded the attributes of the file.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didReceiveAttributes:(NSDictionary *)attributes; 
Parameters
fileDownload

The download that has received the attributes.

data

The received attributes.

Discussion

This method will be called once.


fileDownload:didReceiveData:


This method is called when the download has loaded data.

- (void)fileDownload:(XGFileDownload *)fileDownload 
        didReceiveData:(NSData *)data; 
Parameters
fileDownload

The download that has received data.

data

The received data.

Discussion

This method will be called one or more times. If the download is also being written to disk then this method will be called immediately after the data is written to disk.


fileDownloadDidBegin:


This method is called immediately after the download has started.

- (void)fileDownloadDidBegin:(XGFileDownload *)fileDownload; 
Parameters
fileDownload

The download that just started downloading.


fileDownloadDidFinish:


This method is called when the download has finished downloading.

- (void)fileDownloadDidFinish:(XGFileDownload *)fileDownload; 
Parameters
fileDownload

The download that has finished downloading.

Discussion

This method is called after all the data has been received and written to disk. This method or download:didFailWithError: will only be called once.

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-08-12