我收到以下错误:
使用未声明的标识符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.
}
}
答案 0 :(得分:0)
NSOpenPanel
(iOS
)下macOS
才提供 Cocoa
。
您无法让用户浏览iOS
下的文件系统。您可以使用Apples公共API浏览某些文件类型。例如,您可以让用户使用UIImagePickerController