FROM : Gorazd Krosl
DATE : Tue Nov 20 21:52:35 2007
Hi Arthur,
>NSPipe *pipe = [NSPipe pipe]; // Allocation of
autoreleased "pipe"
>NSFileHandle *fh = [pipe fileHandleForWriting]; //
since "pipe" is autoreleased "fh" is too.
>[fh readInBackgroundAndNotify]; // you are reading in
background, so your app will go through event loop.
When your callback is called, your pipe is probably
released and so your file handle is gone too, which
results in bad file descriptor. Get pipe with [[NSPipe
alloc] init] and release it when done with it.
Regards,
Gorazd
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
DATE : Tue Nov 20 21:52:35 2007
Hi Arthur,
>NSPipe *pipe = [NSPipe pipe]; // Allocation of
autoreleased "pipe"
>NSFileHandle *fh = [pipe fileHandleForWriting]; //
since "pipe" is autoreleased "fh" is too.
>[fh readInBackgroundAndNotify]; // you are reading in
background, so your app will go through event loop.
When your callback is called, your pipe is probably
released and so your file handle is gone too, which
results in bad file descriptor. Get pipe with [[NSPipe
alloc] init] and release it when done with it.
Regards,
Gorazd
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
| Related mails | Author | Date |
|---|---|---|
| AstroK Software | Nov 20, 19:47 | |
| Gorazd Krosl | Nov 20, 21:52 | |
| AstroK Software | Nov 20, 22:12 | |
| Alastair Houghton | Nov 21, 11:47 |






Cocoa mail archive

