2013-01-12 33 views
1

在我的應用程序中,我允許用戶看到他們所有的保管箱文件,他們可以將文件導入保管箱或將它們下載到應用程序中。我查看了Dropbox的網站,但在取消上傳/下載時找不到任何內容。我有一些應用程序(例如Textastic)取消Dropbox Box文件傳輸,我如何取消它,以便刪除下載的數據並停止加載到應用程序中?取消dropbox loadFile

代碼中,我用它來將文件加載到應用程序是:

- (void)startDownloadingDropboxFile:(NSString *)dropboxFilePath toPath:(NSString *)destinationPath { 
    NSLog(@"dropbox file path: %@",dropboxFilePath); 
    NSLog(@"destination path: %@",destinationPath); 
    self.dbFilePath = dropboxFilePath; 
    [[self restClient] loadFile:dropboxFilePath intoPath:destinationPath]; 
} 

回答

2

要取消loadFile:你需要調用:

[[self restClient] cancelFileLoad:dropboxFilePath]; 

顯然,你需要連接這對一些用戶界面按鈕或允許用戶取消下載的其他機制。

此方法需要清理部分下載文件的照顧。

+0

哇!謝謝!取消相信我錯過了那一個。 – Maximilian