Re: Bug w/NSTask and NSPipe? (was: Debugging problems)
Re: Bug w/NSTask and NSPipe? (was: Debugging problems)
- Subject: Re: Bug w/NSTask and NSPipe? (was: Debugging problems)
- From: Mark Ritchie <email@hidden>
- Date: Mon, 28 Mar 2005 20:08:45 -0500
On Mar 28, 2005, at 7:49 PM, Michael Mulligan wrote:
The NSPipe is null some times (but working fine other times)!
The documentation for NSPipe indicates that the 'init' method will
return nil when there are initialization problems. Seems to me that
you need to be very sure that you actually get an instance back from
the method invocation. In this case, you can't skimp on checking the
return value.
Here's the relevant bit from the NSPipe docs:
- (id)init
Returns an NSPipe. Returns nil if the method encounters errors while
attempting to create the pipe or the NSFileHandles that serve as
endpoints of the pipe.
As to why you only see this happen some of the time, that would depend
on why NSPipe is actually failing to setup the pipe.
Anyway, you will probably find that your application runs a whole lot
faster if you don't use the NSPipe and spawn those other processes.
And as someone else pointed out already, launching the other command
line utilities means that you depend on having them installed.
Good luck!
Mark.
__
Mark Ritchie, email@hidden 416-843-5479
Software Developer, Apple Certified Developer Trainer
WebObjects, Cocoa, Mac OS X and Mac OS X Server
Diamond Lake Consulting Inc., Toronto, Ontario, Canada
*** Currently looking for work in Toronto ***
_______________________________________________
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