objective c - UI for finding files on mac -


Maybe because I do not have the proper terminology, I can not find anything on the Internet about my question. I want to have a navigation window that opens on a button click (in fact, what we see when we say that we want to add files to the project and the encoded us have the option to search through a computer to find that file Which gives No!).

How can I get this behavior? If this is a duplicate, please comment and I will remove the question.

What you're searching for is NSOpenPanel

Example usage:

  - (NSInteger) showFilepanel {self.filePanel = [NSOpenPanel openPanel]; [Self File Panel Set Alvezmalti Selection: No]; // This will allow the user to select multiple files [self.filePanel setCanChooseDirectories: NO]; // If you want the user to select a way to save a file, you should enable it so that he can select the directory [self.filePanel setCanChooseFiles: yes]; // To select only files (such as in an open file-scenario) return [self.filePanel runModal]; // If the user is canceled then it will return to 0   

You can then read the selected path like this:

  - (zero) SavePathFromPanel {NSString * path = [[self Pinl url] object endindex: 0]; // now with the selected path you want}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -