如何在使用UIDocumentPickerViewController选择文件时启用多个文件选择?

时间:2017-11-27 13:05:36

标签: ios objective-c uidocumentpickervc

我尝试使用UIDocumentPickerViewController从文件应用中选择文件,但我无法在选择器中看到Select按钮进行多项选择。为什么会这样?我做错了什么?有人可以帮忙吗?

代码段:

NSArray *arrContents = @[@"public.content",@"public.item",@"public.composite-content",@"public.data",@"public.database",@"public.calendar-event",@"public.message",@"public.presentation",@"public.contact",@"public.archive",@"public.disk-image",@"public.text",@"public.plain-text",@"public.utf8-plain-text",@"public.utf16-external-plain-​text",@"public.utf16-plain-text",@"com.apple.traditional-mac-​plain-text",@"public.rtf"];

UIDocumentPickerViewController *dvc = [[UIDocumentPickerViewController 
alloc]initWithDocumentTypes:arrContents inMode:UIDocumentPickerModeImport];
dvc.delegate = self;
[self presentViewController:dvc animated:true completion:nil];

1 个答案:

答案 0 :(得分:1)

初始化dvc.allowsMultipleSelection = true;后设置UIDocumentPickerViewController