Dropbox 错误 - 'uploadData:mode:autorename:clientModified:mute:propertyGroups:inputData:'
Dropbox error in - 'uploadData:mode:autorename:clientModified:mute:propertyGroups:inputData:'
正在尝试将文件上传到保管箱但出现错误:
No visible @interface for 'DBFILESUserAuthRoutes' declares the
selector
'uploadData:mode:autorename:clientModified:mute:propertyGroups:inputData:'
我的代码如下:
DBUserClient * clientt = [DBClientsManager authorizedClient ];
NSData *fileData = [filename dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
// For overriding on upload
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
[[[clientt.filesRoutes uploadData:fullPath
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
inputData:fileData]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (result) {
NSLog(@"%@\n", result);
} else {
NSLog(@"%@\n%@\n", routeError, networkError);
}
}] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) {
NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded);
}];
从 3 天开始在 google 上搜索了很多,即使在 dropbox 官方页面上也得到了相同的代码,但还没有运气。遗漏或错误之处请指点。
Dropbox Objective-SDK 会偶尔更新,有时会包含新参数。当您更新您的 SDK 副本时,或者如果您正在使用为旧版 SDK 编写的旧示例,您可能需要添加参数以匹配您正在使用的版本提供的接口。
例如,在 SDK 的 uploadData
方法中添加了一个 strictConflict
参数。您需要相应地更新代码以添加该参数。如果你想使用默认值,你可以直接传入nil
,像这样:
propertyGroups:nil
strictConflict:nil
inputData:fileData]
或者,您可以像这样传入特定值:
propertyGroups:nil
strictConflict:@(NO)
inputData:fileData]
现在他们还添加了 contentHash(过时的 documentation/not 记录在 API 参考资料中!!!我通过长时间检查 https://dropbox.github.io/dropbox-api-v2-explorer/#files_upload 的 API 资源管理器来识别这个参数长时间的搜索、分析、尝试和错误,最后做出有根据的猜测
[[[client.filesRoutes
uploadData:dropboxpath
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
strictConflict:@(NO)
contentHash:nil
inputData:fileData]
这样的纪录片很烂。
正在尝试将文件上传到保管箱但出现错误:
No visible @interface for 'DBFILESUserAuthRoutes' declares the selector 'uploadData:mode:autorename:clientModified:mute:propertyGroups:inputData:'
我的代码如下:
DBUserClient * clientt = [DBClientsManager authorizedClient ];
NSData *fileData = [filename dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
// For overriding on upload
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
[[[clientt.filesRoutes uploadData:fullPath
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
inputData:fileData]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (result) {
NSLog(@"%@\n", result);
} else {
NSLog(@"%@\n%@\n", routeError, networkError);
}
}] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) {
NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded);
}];
从 3 天开始在 google 上搜索了很多,即使在 dropbox 官方页面上也得到了相同的代码,但还没有运气。遗漏或错误之处请指点。
Dropbox Objective-SDK 会偶尔更新,有时会包含新参数。当您更新您的 SDK 副本时,或者如果您正在使用为旧版 SDK 编写的旧示例,您可能需要添加参数以匹配您正在使用的版本提供的接口。
例如,在 SDK 的 uploadData
方法中添加了一个 strictConflict
参数。您需要相应地更新代码以添加该参数。如果你想使用默认值,你可以直接传入nil
,像这样:
propertyGroups:nil
strictConflict:nil
inputData:fileData]
或者,您可以像这样传入特定值:
propertyGroups:nil
strictConflict:@(NO)
inputData:fileData]
现在他们还添加了 contentHash(过时的 documentation/not 记录在 API 参考资料中!!!我通过长时间检查 https://dropbox.github.io/dropbox-api-v2-explorer/#files_upload 的 API 资源管理器来识别这个参数长时间的搜索、分析、尝试和错误,最后做出有根据的猜测
[[[client.filesRoutes
uploadData:dropboxpath
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
strictConflict:@(NO)
contentHash:nil
inputData:fileData]
这样的纪录片很烂。