Search code examples
objective-ccocoafileselectnsworkspace

How to show window with "Select file" in objective-C cocoa


I've got some action in my application on OS X where I have to select file from finder. I want to display window like: "Open file". I know that this let me open url with path:

[[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:NSHomeDirectory() isDirectory:YES]];

But how to show window with "Select" button. This window should let me to get info about selected file.

How can I do this correctly?

Thank you for help.


Solution

  • @Perception and @omz gives me good answer. Answer is NSOpenPanel.