我可以使用 [Box createFolderWithName:] 来获取 folder_id。但是当我尝试使用 folder_id 来获取它的孩子时,它不起作用。这是我的代码:
[Box createFolderWithName:@"My APP" parentFolderID:[Box rootFolderID] share:NO callbacks:^(id<BoxOperationCallbacks>on){
on.userInfo (^(NSDictionary* result) {
// do something with the return value (typically stored with key @"results") of the operation
NSNumber *appFolderId = [result objectForKey:@"folder_id"];
BoxFolder *appFolder = [Box folderWithID:appFolderId];
[appFolder updateWithCallbacks:^(id<BoxOperationCallbacks>on){
on.after(^(BoxCallbackResponse response) {
if (response == BoxCallbackResponseSuccessful) {
NSLog(@"Folder updated. Children count is: %d", [appFolder.children count]);
// Send a notification, call a delegate, use KVO use locally or whatever to use the children.
}
else {
NSLog(@"Folder not updated.");
}
});
}];
});
}];
孩子总是零。我也尝试了 [Box rootFolder] 但结果相同。
有人可以帮我吗?谢谢。