簡體   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