Created
July 5, 2013 16:00
-
-
Save katsuhide/5935495 to your computer and use it in GitHub Desktop.
FileChooser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | |
| NSLog(@"url:%@", [url path]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment