• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Returning an executable in a framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Returning an executable in a framework (From: Rick Langschultz <email@hidden>)
 >Re: Returning an executable in a framework (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: does NSMenuItem setMixedStateImage or setOnStateImage work?
  • Next by Date: Re: NSLayoutManager subclassing
  • Previous by thread: Re: Returning an executable in a framework
  • Next by thread: initial column of NSTableView sorted
  • Index(es):
    • Date
    • Thread