我嘗試從使用目標c的dropbox中刪除文件或文件夾,並使用目標c執行dropbox中的替換文件。 我在訪問這個鏈接https://www.dropbox.com/developers/core/docs,但我不能得到任何解決方案。我也用谷歌,但我找不到刪除文件夾,文件或替換文件的代碼。 你可以給一些解決方案。所以我可以走得更遠。如何從Dropbox中刪除文件或文件夾使用objectiv-c
這段代碼我試過但我無法得到解決方案。 你能檢查這個嗎?
-(void)DeleteFile
{
DBRestClient *dbClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
[dbClient deletePath:DBdata.path];//DBdata object is DBMetadata for geting path from dropbox
}
-(void)uploadFileToDropBox:(NSString *)filePath
{
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentPath = [searchPaths objectAtIndex:0];
NSString *path = [documentPath stringByAppendingPathComponent:@"/MortgageCalculator.sqlite"];
[self.restClient uploadFile:@"MortgageCalculator.sqlite" toPath:filePath withParentRev:nil fromPath:path];
}
請給演示刪除文件,文件夾和文件替換
感謝
解決方案 嘿, 我得到的解決方案。 請把這個委託方法
- (void)restClient:(DBRestClient*)client deletedPath:(NSString *)path
{
}
- (void)restClient:(DBRestClient*)client deletePathFailedWithError:(NSError*)error
{
}
,並把這個代碼的刪除方法
DBMetadata *metadata = [marrDownloadData objectAtIndex:indexforyourfile];
[self.restClient deletePath:metadata.path];
https://www.dropbox.com/developers/core/docs#fileops-delete < - 這個文檔可以幫助你。請提供您的代碼片段和日誌以指出其失敗的位置。 –
感謝您的重播 我在這裏編輯我的問題我添加我的code.this代碼我試了。 –
在我的應用程序下載文件和上傳文件在收件箱中工作發現,但我不能刪除文件或文件夾和替換文件可以提供我的代碼? –