简体   繁体   English

macOS:setAllowedFileTypes 和文件夹名称的问题

[英]macOS : problem with setAllowedFileTypes and folder name

I work on 10.14, if I wrote:如果我写道,我在 10.14 工作:

NSOpenPanel *panel;
NSArray* fileTypes = [NSArray arrayWithObjects:@"pdf", @"PDF", nil];
panel = [NSOpenPanel openPanel];
[panel setFloatingPanel:YES];
[panel setCanChooseDirectories:NO];
[panel setCanChooseFiles:YES];
[panel setAllowsMultipleSelection:YES];
[panel setAllowedFileTypes:fileTypes];
int i = [panel runModal];
if(i == NSOKButton){
    return [panel URLs];

I can't navigate in folder with ".pdf" extension for exemple "test.pdf".我无法在带有“.pdf”扩展名的文件夹中导航,例如“test.pdf”。

Anyone had already encountered this problem?有人遇到过这个问题吗?

Best regards此致

This sounds like a general problem.这听起来像是一个普遍的问题。 If I create a folder named "test.jpg" with a file inside it, Safari can't open it.如果我创建一个名为“test.jpg”的文件夹,其中包含一个文件,Safari 无法打开它。 I apply "File>Open a file" in Safari and the folder appear like a file and I can't open it.我在 Safari 中应用“文件>打开文件”,该文件夹看起来像一个文件,我无法打开它。

Best regards此致

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM