Re: lunch application
Re: lunch application
- Subject: Re: lunch application
- From: John Stiles <email@hidden>
- Date: Thu, 27 Oct 2005 22:55:04 -0700
There is a tech note which you will probably find interesting:
http://developer.apple.com/technotes/tn/tn2050.html
한유림 wrote:
>Hi,
>
>I want to open the other application on my program.
>
>
>I tried NSWorkspace for lauch app(ABC Installer).
>This method is well-opened. But my program does not know the end of ABC Installer.
>
>So I was changed to NSTask. But it is not called when my program is run. It occured "launch path not accessible" problem.
>But in case of TextEdit.app, no problem.
>
>
>Here's is my code...
>--------------------------------------------------------------------------------------------------------------------------------------------------
> NSTask *aTask = [[NSTask alloc] init];
>
> // [[NSWorkspace alloc] launchApplication:@"/Volumes/COM/ABC Installer/ABC Installer"]; //1.NSWorkspace
> [[aTask setLaunchPath:@"/Volumes/COM/Installer/ABC Installer/Contents/MacOSClassic/ABC Installer"]; //2.NSTask
> // [aTask setLaunchPath:@"/Volumes/OS X/Applications/TextEdit.app/Contents/MacOS/TextEdit"]; //3.TextEdit.app
>
> [aTask autorelease];
> [aTask launch];
>
> [aTask waitUntilExit];
>
> if ([aTask isRunning])
> {
> NSLog(@"Task is running.");
> }
> else
> {
> NSLog(@"end.");
> [NSApp terminate:self];
> }
>------------------------------------------------------------------------------------------------------------------------------------------------
>does anyone have an idea? help me..
>
>ally.
>
>
>------------------------------------------------------------------------
>
> _______________________________________________
>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