我正在使用保管箱objc API,并尝试在特定保管箱文件夹中获取所有缩略图。
但是我完全陷入了DBFILESGetThumbnailBatchArg的困境。如何初始化文件夹中所有图像的路径?
这是我遇到的问题:
[[client.filesRoutes getThumbnailBatch:<#(nonnull NSArray<DBFILESThumbnailArg *> *)#>]
setResponseBlock:^(
DBFILESGetThumbnailBatchResult * _Nullable result,
DBFILESGetThumbnailBatchError * _Nullable routeError,
DBRequestError * _Nullable networkError) { etc etc..
文件说
DBFILESThumbnailArg *arg = [[DBFILESThumbnailArg alloc] initWithPath:<#(nonnull NSString *)#>];
DBFILESGetThumbnailBatchArg *batchArg = [[DBFILESGetThumbnailBatchArg alloc]
initWithEntries:<#(nonnull NSArray<DBFILESThumbnailArg *> *)#>];
如何初始化DBFILESThumbnailArg的路径列表?
链接到文档:
https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESRouteObjects.html#/c:objc(cs)DBFILESRouteObjects(cm)DBFILESGetThumbnailBatch
最佳答案
如您所见,the getThumbnailBatch
method需要一个NSArray<DBFILESThumbnailArg *>
,因此调用它看起来像这样:
NSArray<DBFILESThumbnailArg *> *entries = @[[[DBFILESThumbnailArg alloc] initWithPath:@"/test1.jpg"], [[DBFILESThumbnailArg alloc] initWithPath:@"/test2.jpg"]];
[[client.filesRoutes getThumbnailBatch:entries]
setResponseBlock:^(DBFILESGetThumbnailBatchResult *result, DBFILESGetThumbnailBatchError *routeError, DBRequestError *networkError) {
if (result) {
NSLog(@"result:");
NSLog(@"%@", result);
} else if (routeError) {
NSLog(@"routeError:");
NSLog(@"%@", routeError);
} else if (networkError) {
NSLog(@"networkError:");
NSLog(@"%@", networkError);
};
}];
关于ios - 使用getThumbnailBatch获取保管箱缩略图,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59936884/