NSTask, NSApp, and hiding
NSTask, NSApp, and hiding
- Subject: NSTask, NSApp, and hiding
- From: "David Piasecki" <email@hidden>
- Date: Wed, 19 Jan 2005 16:54:06 -0800
I'm trying to launch the Firefox browser from my main application using
an NSTask while hiding my application until the Firefox application
quits. I can launch Firefox with no problem, but my application hides
after Firefox is closed, and I'm not sure why since I tell my
application to "unhide". Maybe it will become clear if I paste the
code...
- (IBAction)LaunchFirefoxFromMenu:(id)sender
{
[NSApp hide:nil]; // hide current application
NSTask *task = [[NSTask alloc] init];
[task
setLaunchPath:@"/Applications/Firefox.app/Contents/MacOS/firefox"]; //
set launch path
[task launch]; // launch firefox
[task waitUntilExit]; // waits for firefox to exit before continuing
[NSApp unhide:nil]; // should unhide my application, bringing it back
into view
}
Thanks,
David
_______________________________________________
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