0

[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.");
                }
            });


        }];


    });

}];

children は常に nil です。[Box rootFolder] でも試してみましたが、同じ結果でした。

誰でも私を助けることができますか?ありがとう。

4

1 に答える 1

0

以下のサンプルが参考になると思います。

if (appFolder.isFolder) {
        [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.");
                }
            });
        }];
    }
    else {
        NSLog(@"NOT WORKING WITH A FOLDER!");
    }
于 2013-03-27T14:41:48.687 に答える