On Jul 12, 2012, at 9:33 AM, Jerry Krinock wrote:
> What is the best way to make a helper app quit when the associated main app
> quits (or crashes)? No harm will be done if it keeps running for a minute or
> so.
Take a look at
http://stackoverflow.com/questions/284325/how-to-make-child-proc
Thanks for all the ideas.
I thought maybe someone would suggest opening up some snazzy inter application
communication channel and making the helper exit when it broke (indicating that
the main app had terminated). But since that was not offered, I used a
combination of the suggestions and som
> Although rare, it is possible to have more than one app with the same bundle
> id running at the same time.
Sorry - I wrote that code in email and mixed up the ProcessIdentifier
return type with the BundleIdentifier return type in my head.
Correct code for bundle ID should look like this:
On Thu, Jul 12, 2012 at 9:33 AM, Jerry Krinock wrote:
> What is the best way to make a helper app quit when the associated main app
> quits (or crashes)? No harm will be done if it keeps running for a minute or
> so.
A solution that does not involve killing the helper application from
the main
On Thu, 12 Jul 2012 10:54:13 -0700, Mark Munz said:
>If you're on 10.6 or later:
>
>- (void)applicationWillTerminate:(NSNotification *)aNotification
>{
> NSRunningApplication* helperApp = [NSRunningApplication
>runningApplicationsWithBundleIdentifier:@"bundle.id"];
> [helperApp termina
On Jul 12, 2012, at 12:33 PM, Jerry Krinock wrote:
> What is the best way to make a helper app quit when the associated main app
> quits (or crashes)? No harm will be done if it keeps running for a minute or
> so.
I create a pthread with this code
pid_t ppid = getppid ();// g
If you're on 10.6 or later:
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
NSRunningApplication* helperApp = [NSRunningApplication
runningApplicationsWithBundleIdentifier:@"bundle.id"];
[helperApp terminate];
}
Sadly, you can't send a terminate command if you're
One thing I've done in the past is get the PID of the main app before launching
the helper, and pass it as a command line argument to the helper (or something
similar) when it's launched. The helper app then periodically polls for the
existence of that PID, and when it discovers it's no longer t
The best way? I have no idea… This is what I do, and it works.
I store the path to my helper app in 'path', and do the following when my app
is about to quit:
//-
- (void)applicationWillTerminate:(NSNotification *)aNotification
What is the best way to make a helper app quit when the associated main app
quits (or crashes)? No harm will be done if it keeps running for a minute or
so.
Thanks,
Jerry Krinock
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do no
10 matches
Mail list logo