• 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
Re: Bug w/NSTask and NSPipe? (was: Debugging problems)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Debugging problems (From: Stéphane Sudre <email@hidden>)
 >Re: Debugging problems (From: Michael Mulligan <email@hidden>)
 >Re: Debugging problems (From: glenn andreas <email@hidden>)
 >Re: Debugging problems (From: Michael Mulligan <email@hidden>)
 >Re: Debugging problems (From: Ondra Cada <email@hidden>)
 >Re: Debugging problems (From: Michael Mulligan <email@hidden>)
 >Re: Debugging problems (From: glenn andreas <email@hidden>)
 >Re: Debugging problems (From: Michael Mulligan <email@hidden>)
 >Bug w/NSTask and NSPipe? (was: Debugging problems) (From: Michael Mulligan <email@hidden>)

  • Prev by Date: Bug w/NSTask and NSPipe? (was: Debugging problems)
  • Next by Date: Re: NSMatrix Drag Reordering/Swapping
  • Previous by thread: Bug w/NSTask and NSPipe? (was: Debugging problems)
  • Next by thread: NSMatrix Drag Reordering/Swapping
  • Index(es):
    • Date
    • Thread