• 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: Launch a Cocoa application from CoreFoundation with arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch a Cocoa application from CoreFoundation with arguments


  • Subject: Re: Launch a Cocoa application from CoreFoundation with arguments
  • From: daniel <email@hidden>
  • Date: Sun, 20 Feb 2005 10:26:42 -0800

Two ideas:

1. Use LaunchServices to locate, but not to launch, the app in question. Once you've located the application, use the CFBundle APIs to ultimately call CFBundleCopyExecutableURL on the application's bundle. Now you can exec the executable directly using a POSIX exec call. I believe Cocoa frameworks "hook up" all the bundle related information even when you manually execute the executable contained within it.

2. Use CFNotifciationCenter to post a notification from your CF tool to the Cocoa app. You might post one from the app to say "I'm done launching" and another from the tool to say "ok, here's the info. bye."

Daniel


On Feb 20, 2005, at 8:16 AM, Arthur VIGAN wrote:

Hi,

I am working on a CoreFoundation application that sometimes need to launch a Cocoa application. I have found out that launching the Cocoa application can be quite easy using LaunchServices. But the problem is that I need to pass arguments (just like for command line tools) to the Cocoa executable. Does someone know if it's possible, and if it, how to do it?

I know it seems weird doing this, but the problem is that I need to pass information from the CoreFoundation application to the Cocoa application... Maybe is there a better way to do this that I am not aware of? I have to tell that the CoreFoundation application quits immediately after having launched the Cocoa application.

Thanks a lot in advance,

 -- Arthur;

--
Arthur VIGAN
<email@hidden>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Launch a Cocoa application from CoreFoundation with arguments (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: NSApplication Bug or Feature: Keystroking -performClose closes all windows?
  • Next by Date: Re: Getting VSIZE-RSIZE from process id
  • Previous by thread: Launch a Cocoa application from CoreFoundation with arguments
  • Next by thread: Getting VSIZE-RSIZE from process id
  • Index(es):
    • Date
    • Thread