Re: "broken pipe", but not when debugging...
It does seem absurd that the most fundamental APIs — the C standard library and POSIX/Darwin system calls — aren’t supported by Xcode’s documentation features. Especially since the header files give zero information, usually not even parameter names. I assume this is something hundreds of people have already filed bug reports about over the years.
I just end up typing “man foo” in a Terminal window, or using the awesome Dash app.
Jack Brindle wrote:
Be sure and put the data write into a try-catch block in order
I think this is a separate (but related) issue. NSTask is one of the few Cocoa APIs that will throw exceptions in ‘normal’ use to indicate a runtime error, so your advice is correct. But the SIGPIPE crash is different — signals are not exceptions, they’re an earlier lower-level mechanism.