1

我知道如何创建一个目录,例如:

[[self restClient] createFolder: folderName];

但是如果我想在文件夹“A”中创建文件夹“B”,我该怎么做呢?

目录层次结构为:A > B > c.txt

我可以创建“A”,但不能在 A 中创建 B。

任何帮助,将不胜感激。

4

1 回答 1

2

你已经完成了一半,试试这个

[[self restClient] createFolder:@"A"];

然后

[[self restClient] createFolder:@"A/B"];


- (void)restClient:(DBRestClient*)client createdFolder:(DBMetadata*)folder{
    NSLog(@"Meta Data Path %@",[folder path]);
    NSLog(@"Meta Data Filename %@",[folder filename]);
    NSLog(@"Meta has directory %d",[folder isDirectory]);

}
// Folder is the metadata for the newly created folder
- (void)restClient:(DBRestClient*)client createFolderFailedWithError:(NSError*)error{
    NSLog(@"Fail Error %@",error);
}
// [error userInfo] contains the root and path

元数据和关于创建文件夹

于 2012-07-17T15:03:36.890 回答