[英]Error: Use of undeclared identifier NSOpenPanel in Xcode
我收到以下错误:
使用未声明的标识符NSOpenPanel
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:YES]; // yes if more than one dir is allowed
NSInteger clicked = [panel runModal];
if (clicked == NSFileHandlingPanelOKButton)
{
for (NSURL *url in [panel URLs])
{
// do something with the url here.
}
}
NSOpenPanel
在iOS
不可用,仅在macOS
( Cocoa
)下可用。
您不能让用户在iOS
下浏览文件系统。 您可以使用Apples公共API浏览某些文件类型。 例如,您可以让用户使用UIImagePickerController选择图像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.