I’m wondering how to make a button or input field in Interface Builder react in such a way that on click it opens a file dialog and lets you select one or more files and puts them into a specified array/table…
Once the button is pushed and files are chosen (this seems a like quite trivial thing) I guess it will already contain some sort of array (like an array with paths to the selected files) so I’ve got that covered.. I only need to know how to link the button to a file selector and in what way the file selector delivers the files to me (or paths to the files) so I can redirect them to the array
Is there an easy way to do this, and more importantly; is there a file selector thingie or do I have to do this with XCode instead of Interface builder?
This must be done in Xcode. The code here should work fine.
Just hook the button up with a method using IB and use that example as a guide of what to put in the method.
There’s also all sorts of good help WRT NSOpenPanel at Cocoadev, including tips on opening the panel as a sheet instead of a modal window.
Of course you should always read the Apple documentation as well.