Task create failed error for NSTask
Task create failed error for NSTask
- Subject: Task create failed error for NSTask
- From: Fei Li <email@hidden>
- Date: Thu, 15 Nov 2001 13:25:00 -0700
Hello all,
I tried to launch a application named "abc.app" use NSTask, I write code
as follows:
NSArray * args = [[NSArray alloc] initWithObjects:@"2", nil];
[NSTask launchedTaskWithLaunchPath:@"/Users/feil/Desktop/abc.app"
arguments:args];
I always get error message:Task create for path abc.app failed.
I think maybe I should change current directory for the NSTask, so I
change my code to
NSArray * args = [[NSArray alloc] initWithObjects:@"2", nil];
NSTask * theTask = [[NSTask alloc] init];
[theTask setCurrentDirectoryPath:@"/Users/feil/Desktop/"];
[theTask setLaunchPath:@"abc.app"];
[theTask setArguments:args];
[theTask launch];
But I also get the same error.
Thanks for any help for helping me out!
Fei