繁体   English   中英

错误:在Xcode中使用未声明的标识符NSOpenPanel

[英]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.
    }
}

NSOpenPaneliOS不可用,仅在macOSCocoa )下可用。

您不能让用户在iOS下浏览文件系统。 您可以使用Apples公共API浏览某些文件类型。 例如,您可以让用户使用UIImagePickerController选择图像

暂无
暂无

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

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