我正在学习Dropbox SDK。我想了解如何显示用户Dropbox文件夹,以及让用户选择将文件从我的应用程序上传到他们的Dropbox帐户。
我查看了他们的示例应用,但它没有提供我需要的信息。
有人可以帮我这个吗?
答案 0 :(得分:0)
我认为您可能会发现本教程很有用。 http://www.nanaimostudio.com/blog/2011/1/20/how-to-synchronize-your-app-data-using-dropbox-api.html
您可以在DBRestClient对象上调用upload方法。
NSString* path = [self getDocumentPath];//or however you can obtain the path where your file is stored
[restClientObject uploadFile:@"filename" toPath:@"/" fromPath:path];
//you can choose to upload to the dropbox root directory(above) or a folder of your choice eg toPath:@"/myfolder"
NSString* path = [self getDocumentPath];//or however you can obtain the path where your file is stored
[restClientObject uploadFile:@"filename" toPath:@"/" fromPath:path];
//you can choose to upload to the dropbox root directory(above) or a folder of your choice eg toPath:@"/myfolder"
使用loadMetaData显示dropbox文件夹的内容
您还必须实现 [restClientObject loadMetadata:@""];
[restClientObject loadMetadata:@""];
功能。请参阅上面的教程。
答案 1 :(得分:0)
-(void)restClient:(DBRestClient *)client loadedMetadata:(DBMetadata *)metadata{
NSMutableArray *list=[[NSMutableArray alloc] init];
for (DBMetadata *child in metadata.contents) {
[list addObject:child];
}
self.arrayFoldersList=[[NSMutableArray alloc] initWithArray:list];
[self.tableView reloadData];
}
[self.restClient loadMetadata:@""];
我认为这会对你有所帮助。