gpt4 book ai didi

ios - 使用新的 Dropbox SDK (V2) 和 filesRoutes 的 downloadUrl :overwrite:destination: method 跟踪进度

转载 作者:行者123 更新时间:2023-11-29 00:21:45 25 4
gpt4 key购买 nike

我正在尝试使用新的 dropbox SDK 下载大文件。

我的下载代码是这样的-

DBUserClient *client = [DBClientsManager authorizedClient];

[[client.filesRoutes downloadUrl:remotePath overwrite:YES destination:documentUrl] setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError, NSURL *destination) {
if(result){
NSLog(@"File Downloaded");
// open the file after being downloaded
}
}];

以前我曾经使用 DBRestClient 类的 loadMetadata 方法。

[restClient loadMetadata:path];

这又会触发其他一些委托(delegate)方法,其中之一是

- (void)restClient:(DBRestClient*)client loadProgress:(CGFloat)progress forFile:(NSString*)destPath

在这种方法中,我可以跟踪正在下载的文件的进度。

如何在 setResponse block 中跟踪我的下载进度?提前致谢。

最佳答案

您可以使用 setProgressBlock 设置 block 以接收进度更新。这里有一个例子:

https://github.com/dropbox/dropbox-sdk-obj-c#download-style-request

关于ios - 使用新的 Dropbox SDK (V2) 和 filesRoutes 的 downloadUrl :overwrite:destination: method 跟踪进度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44044325/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com