Ios [[BoxSDK sharedSDK].foldersManager createFolderWithRequestBuilder:builder成功:成功:失败]未工作
我在box.com中创建文件夹时遇到问题。这是我的代码。我在foldersManager createFolderWithRequestBuilder中遇到问题,如果我在返回的断点上得到“op=POST” 什么是self.folderID? 它应该是框中存在的文件夹的有效文件夹ID。 要保存到“所有文件”,请从builder.parentID=@“0”开始 顺便说一句,您在故障块中得到的错误消息是什么? 是否执行故障块? 我说的是这句话:Ios [[BoxSDK sharedSDK].foldersManager createFolderWithRequestBuilder:builder成功:成功:失败]未工作,ios,directory,box-api,Ios,Directory,Box Api,我在box.com中创建文件夹时遇到问题。这是我的代码。我在foldersManager createFolderWithRequestBuilder中遇到问题,如果我在返回的断点上得到“op=POST” 什么是self.folderID? 它应该是框中存在的文件夹的有效文件夹ID。 要保存到“所有文件”,请从builder.parentID=@“0”开始 顺便说一句,您在故障块中得到的错误消息是什么? 是否执行故障块? 我说的是这句话: NSLog(@“文件夹创建失败,错误代码:%i”,响应。
NSLog(@“文件夹创建失败,错误代码:%i”,响应。状态代码) 我改为builder.parentIDD=@“0”;得到了同样的结果。成功和失败都会阻碍执行。
- (void)boxAPIAuthenticationDidSucceed:(NSNotification *)notification
{
NSLog(@"Received OAuth2 successfully authenticated notification");
BoxOAuth2Session *session = (BoxOAuth2Session *) [notification object];
NSLog(@"Access token (%@) expires at %@", session.accessToken, session.accessTokenExpiration);
NSLog(@"Refresh token (%@)", session.refreshToken);
dispatch_sync(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
});
BoxFolderBlock success = ^(BoxFolder *folder)
{
[self fetchFolderItemsWithFolderID:self.folderID name:self.navigationItem.title];
};
BoxAPIJSONFailureBlock failure = ^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSDictionary *JSONDictionary)
{
NSLog(@"folder create failed with error code: %i", response.statusCode);
if (response.statusCode == 409)
{
dispatch_sync(dispatch_get_main_queue(), ^{
UIAlertView *conflictAlert = [[UIAlertView alloc] initWithTitle:@"Name conflict" message:[NSString stringWithFormat:@"A folder already exists with the name %@.\n\nNew name:", @"ezMedRecords"] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
conflictAlert.alertViewStyle = UIAlertViewStylePlainTextInput;
[conflictAlert show];
});
}
};
BoxFoldersRequestBuilder *builder = [[BoxFoldersRequestBuilder alloc] init];
builder.name = @"ezMedRecords";
builder.parentID = self.folderID;
BoxAPIJSONOperation *op;
op = [[BoxSDK sharedSDK].foldersManager createFolderWithRequestBuilder:builder success:success failure:failure];
return;
}