Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tmeehan

macrumors newbie
Original poster
Feb 25, 2009
12
0
I have been programming on the mac for many years but I am quite new to interface builder and cocoa. My question is probably quite simple to answer.

I have a button that is used to bring up the file selection dialog to choose a file. I've created the connection between my button and the first responder's openDocument method. Everything works fine.... I click the button and up comes the file selection dialog. BUT how do I get a reference to the document that was selected. I would imagine that there must be an NSDocument object being created - maybe not.

What am I missing. Any help with this would be greatly appreciated.

Thanks.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I'm guessing [[NSDocumentController sharedDocumentController] currentDocument] would work.
 

Gargantua

macrumors newbie
Sep 6, 2009
6
0
Hi,
I got the same problem and stumbled into this almost three year old thread.
Did you make any progress?

Ok, I could use NSFileManager or NSWorkspace. But using this build-in OpenDocument seems to be a nice and elegant way to do this.

Greetings, Ronald
---
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.