Re: Double Clicking File Isn't Working to Load NSDocument
Re: Double Clicking File Isn't Working to Load NSDocument
- Subject: Re: Double Clicking File Isn't Working to Load NSDocument
- From: "Louis C. Sacha" <email@hidden>
- Date: Tue, 13 Apr 2004 21:46:27 -0700
Hello...
Does the document open correctly if the application is already
running and then you double click the document file in the Finder?
If the problem occurs even when the application is already running
and a document is double clicked, you could debug it in the normal
way after launching it from within xcode or project builder.
Otherwise, if it only occurs if the application is launched by double
clicking a document:
If you have messed around with the main() function recently, you
should check and make sure that the arguments are being passed
correctly to the NSApplicationMain() call.
You might want to check out the description of the
applicationDidFinishLaunching: delegate method for NSApplication,
specifically since it says that it might be called after
application:openFile: if a file was double clicked to launch the app.
If you have implemented applicationDidFinishLaunching: or a using
the equivalent notification to do something important, it may be the
cause of the error since the app will attempt to open the file before
that notification is sent.
If you are using xcode, you could probably simulate launching with a
double clicked document by setting an appropriate argument(s) for the
executable (I haven't actually done this myself, so you'd have to
read up in the xcode docs for more info on how to do that).
If that won't work, when you aren't running inside PB or xcode,
NLog() outputs to either the console or system log, so you could
debug that way, or read up on using gdb from the command line...
Louis
Hi,
I have a pretty big project. It is a multiple document app.
I can open the documents defined in its plist when the app is up and
running via the open menu command. Yet, all of a sudden double
clicking a file isn't opening the file in the application. The app
fires up and no document with window controller and user interface.
I do have a sub class of NSDocumentController in my main nib file.
But it has always worked. None of my clients or users are
complaining. Could this be something on my hard drive that I am
ignorant of?
Do I have a way of debugging this, because the app has to be
unlaunched, so, the double clicking of the file opens the app, and
opens the file with window controller. I am lost in this one.
Help...
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.