How do I show a file chooser dialog on Mac OS X? The language is Objective C.
See Question&Answers more detail:osHow do I show a file chooser dialog on Mac OS X? The language is Objective C.
See Question&Answers more detail:osWhat you search is 'NSOpenPanel', here a example how to use:
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.
}
}