• 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: Launching another process, and knowing when it's loaded?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching another process, and knowing when it's loaded?


  • Subject: Re: Launching another process, and knowing when it's loaded?
  • From: Yann Bizeul <email@hidden>
  • Date: Tue, 13 Sep 2005 18:46:01 +0200

What about
    NSWorkspaceDidLaunchApplicationNotification and
    NSWorkspaceDidTerminateApplicationNotification

    NSWorkspace's notifications ?

Yann Bizeul • yann at tynsoe.org
Cocoa Developer

Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...
http://projects.tynsoe.org/

Le 13 sept. 05 à 17:24, Theodore H. Smith a écrit :


This is probably due to the inherant nature of the MacOS, but here goes:


Using NSWorkspace to launch an auxiliary process, I am finding it hard to reliably tell when the process has actually opened, and then tell when it's actually closed.

I'm using NSWorkspace's launchedApplications method, but the thing is, I'm not sure if the app I'm launching will always be in the process list immediately after launchApplication returns.

So, it's like this;

[ws launchApplication:kAppPath showIcon:NO autolaunch:NO];
// is the app open by the time my code gets here, or not?
bool b = CheckIfAppExists();


Can I assume that the app won't open and close by the time the function has returned?


For example b could be false if the app has already opened and closed.

or b could be false if the app hasn't yet opened!

Assumptions are generally bad things, right? I wonder if I could make this auxiliary app wait for the parent app to signal for it to quit? That would make more sense, and remove an assumption.

I guess I just want to know the most graceful way of doing this. I'll be able to do it reliably, but doing it the most simple graceful way is a different matter :)


-- http://elfdata.com/plugin/

What does our work achieve, if it's not making the world a happier place?
http://www.whatnextjournal.co.uk/Pages/Next/Happiness.html
When's the last time you thought deeply about how to improve our lives?



_______________________________________________ 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



_______________________________________________ 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: 
 >Launching another process, and knowing when it's loaded? (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: OT: porting PC to Mac - possible market?
  • Next by Date: Re: How do I unsubscribe?
  • Previous by thread: Launching another process, and knowing when it's loaded?
  • Next by thread: Re: Launching another process, and knowing when it's loaded?
  • Index(es):
    • Date
    • Thread