1
我收到以下错误使用未声明的标识符NSOpenPanel的:错误:在Xcode
Use of undeclared identifier 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.
}
}
如何在objective-c中打开文件选取器?你可以发送示例代码吗? – Prabhu
iOS下没有文件选择器。 – shallowThought
然后如何以编程方式浏览文件? – Prabhu