我知道如何创建目录,例如:
[[self restClient] createFolder: folderName];
但如果我想在文件夹“A”中创建文件夹“B”,我该怎么做?
目录层次结构是: A> B> c.txt
我可以创建“A”,但我不能在A中创建B.
任何帮助都将不胜感激。
答案 0 :(得分: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