NSTask
NSTask
- Subject: NSTask
- From: Mai Bui <email@hidden>
- Date: Wed, 12 Jan 2005 14:24:00 -0800
Hi all,
I try to use NSTask but somehow it can not take arguments, in Cocoa application (named: MyApp) I use:
- (id)sender
{
NSTask *task;
task = [[NSTask alloc] init];
// Set attribute of new process
[task setLaunchPath:@"~/TestProg/build/Test"];
[task setArguments:[NSArray arrayWithObjects:@"5"]];
// Start the new process
[task launch];
// [task waitUntilExit]; Do I need to???
[task release];
}
And in TestProg:
int main (int argc, const char * argv[]) {
printf("Hello, World! %c\n", *argv[1]);
return 0;
}
TestProg runs ok alone, but when I run "MyApp", I got err:
Executable “MyApp” has exited due to signal 10 (SIGBUS)
What did I do wrong?
Thanks for any reply.
Mai Bui N.
MPL - SIO
email@hidden
(858)534-4733
_______________________________________________
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