gpt4 book ai didi

cocoa - NSOpenPanel - 设置文件类型?

转载 作者:行者123 更新时间:2023-12-03 16:06:49 26 4
gpt4 key购买 nike

只是看看我会用什么来只允许选择特定文件(现在是图像)

setFileTypesArray 返回

NSOpenPanel may not respond to -setFileTypesArray:

然后面板根本打不开。这是我的代码:

    NSArray  * fileTypes = [NSArray arrayWithObjects:@"png",@"tiff",@"baz",nil];

NSLog(@"Button Pressed");
[textField setStringValue:@"Test"];
int i; // Loop counter.

NSOpenPanel* openDlg = [NSOpenPanel openPanel];

[openDlg setCanChooseFiles:YES];
[openDlg setFileTypesArray:fileTypes];

谢谢。

最佳答案

怎么样[openDlg setAllowedFileTypes:fileTypes];

关于cocoa - NSOpenPanel - 设置文件类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4289511/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com