• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTask
      • From: Nick Zitzmann <email@hidden>
References: 
 >Question about an NSScanner loop (From: Matt Crocker <email@hidden>)

  • Prev by Date: IB, multiple table views, and view resizing
  • Next by Date: Re: Question about an NSScanner loop
  • Previous by thread: Re: Question about an NSScanner loop
  • Next by thread: Re: NSTask
  • Index(es):
    • Date
    • Thread