Re: [aTask setLaunchPath:@MYLOCALOBJECTIVECROUTINE]
Re: [aTask setLaunchPath:@MYLOCALOBJECTIVECROUTINE]
- Subject: Re: [aTask setLaunchPath:@MYLOCALOBJECTIVECROUTINE]
- From: Eric Peyton <email@hidden>
- Date: Sun, 13 Oct 2002 08:49:49 -0500
On Saturday, October 12, 2002, at 08:28 PM, devdrvr.net Multi-Platform
SW wrote:
Want to launch a local routine in my code with an
NSTask. Perhaps this is a complete misuse of the
class. Has anyone changed setLaunchPath to fire
up a local method or external C++ method call?
aTask = [[NSTask alloc] init];
// Instead of:
// [aTask setLaunchPath:@"/bin/ls"];
// Want to:
[aTask setLaunchPath:@MYLOCALOBJECTIVECROUTINE]
[aTask setArguments:nil];
...
Reason I'm doing is to send standard output to an NSPipe
standard out from what? Your own process? Or from another process?
This is not an appropriate use of NSTask. NSTask is used to launch
other processes and grab their output (or not). An NSTask can't
"launch"
a local routine (only executables).
If you are just trying to get stdout from another process there are
lots of good examples of that on these lists and on Apple.com.
If you are trying to redirect stdout in your process that is a
different story. I think a good book on Unix could help you out there.
Eric
and then put that pipe to a text field in my Cocoa app's
window. Maybe there is another way, NSConnection or
otherwise. Open to suggestions.
--Perry
========
01 (530) 400-5692 [Davis, CA USA]
mailto:email@hidden
http://www.devdrvr.net/PerryCard.html
ftp://www.devdrvr.net/
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.