我正在尝试通过以下方式从保管箱中保存文件:
NSString *fileName = [NSString stringWithFormat:@"/newFile.json"];
// Do any additional setup after loading the view, typically from a nib.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString* path2 = [documentsDirectory stringByAppendingPathComponent:
[NSString stringWithFormat:@"%@", fileName]];
[[self restClient] loadFile:fileName intoPath:path2];
文件在apps/appname/sandbox/newFile.json下
但是我得到这个错误:
2012-05-12 21:05:46.824 快速作业和业务[934:707] [警告] DropboxSDK:向/1/files/sandbox/newFile.json 发出请求时出错 - 找不到文件
但是文件在那里!!
最佳答案
我发现为了访问所有保管箱文件夹,即使在沙箱文件夹中,您的应用也需要设置为“完全保管箱访问权限”,否则会出现此错误。这个问题只在尝试从 Dropbox 下载时存在,在上传或在 UITableView 中加载元数据时不存在。
关于objective-c - 从 Dropbox 下载文件并保存到路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10566587/