[FAQ] Double Clicking Associated file to Open an application & Debugger
[FAQ] Double Clicking Associated file to Open an application & Debugger
- Subject: [FAQ] Double Clicking Associated file to Open an application & Debugger
- From: Chris Espinosa <email@hidden>
- Date: Wed, 11 Apr 2007 07:43:26 -1000
On Apr 11, 2007, at 7:09 AM, Alexandre NEGRI (REALVIZ) wrote: I made an application, and associated file (.foo for the example). I want double clicking .foo file to open my application, AND load the .foo file.
For now, it double clicking this file launch the application but nothing else is done.
- What may I have forget ? - What may I do to debug this process ? (double clicking the file launch me the application OUTSIDE any debugger)
I use XCode 2.4 on MacOs 10.4.9 and I use QT TrollTech ...
When I launch my application through command line with .foo in argument in a terminal, it works. (it launchs application and load file)
Your application makes assumptions about the working directory at launch time, and refers to .foo via a relative path from the working directory. This is fragile. You cannot depend on the working directory being set to any particular place at launch time; specifically, the Finder and Xcode both set it differently from where you will with the command line.
The best way to fix this is to use a more robust way of finding .foo (for example, passing its path as a parameter). You can work around this by choosing Edit Active Exectuable from the Project menu, choosing the Debugging tab, and setting the Working Directory to be the one that contains .foo (usually the Project directory).
Chris |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden