Re: Returning an executable in a framework
Re: Returning an executable in a framework
- Subject: Re: Returning an executable in a framework
- From: Douglas Davidson <email@hidden>
- Date: Thu, 19 Jan 2006 09:23:15 -0800
On Jan 19, 2006, at 8:24 AM, Nick Zitzmann wrote:
On Jan 19, 2006, at 8:40 AM, Rick Langschultz wrote:
Would I do something like:
NSTask *loadxml = [NSTask launchedTaskWithLaunchPath:@"/
Applications/MyApp.app/Contents/Frameworks/XML.framework/Resources/
load_xml"]
Or is there something better I can do to load_xml???
Never do that, because it's a bad idea to hard-code paths. Instead,
try getting the NSBundle object pointing to the framework, and then
use the -pathForAuxiliaryExecutable: method to locate the executable.
Definitely use NSBundle to locate the executable within your
application bundle. If you put it in the same directory as the main
application executable, then you would use -
pathForAuxiliaryExecutable:. If you put it in Resources, you would
use -pathForResource:ofType:. Either one will work.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden