【发布时间】:2014-03-07 10:45:36
【问题描述】:
Dropbox 和其他教程中的所有文档都在讨论创建新文件并使用同步 api 与 Dropbox 同步。
我的应用文档目录中有一些文件,我想将它们与 Dropbox 服务器同步。
这就是我所做的。
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"emmy.txt"];
DBPath *newPath = [[DBPath root] childPath:path];
DBFile *file = [[DBFilesystem sharedFilesystem] createFile:newPath error:nil];
//[file writeString:str error:nil];
DBFileStatus *status = file.status;
if (!status.cached) {
[file addObserver:self block:^() {
}];
}
在 Dropbox 上创建的文件,但它是空的。我的应用程序中的文件有内容。
如何使用 Dropbox 同步 api 将现有文件上传到我的应用中的 Dropbox?
【问题讨论】:
标签: ios iphone ipad sync dropbox-api