Re: Launching Cocoa Application externally
Re: Launching Cocoa Application externally
- Subject: Re: Launching Cocoa Application externally
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 15 May 2008 18:48:32 +0200
Le 15 mai 08 à 18:42, Yann Disser a écrit :
Thank you all for your help. I managed to fix the problem by going
over your suggestions.
The problem was that I access a file (without proper error-handling;
I will add that now :-)). The default working directory is the main-
bundle path when run from within XCode and it is "/" when run from
Finder.
I repaired this by adding
[[NSFileManager defaultManager] changeCurrentDirectoryPath:
[[[NSBundle mainBundle] bundlePath]
stringByDeletingLastPathComponent]];
to my awakeFromNib. I hope this works as I intend.
Yann
I hope your are not trying to access some bundle resources using a
relative path? To access resources into a bundle you should always use
NSBundle methods, it will avoid you this kind of problem.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden