Re: NSTask, NSFileHandle, readInBackgroundAndNotify and avoiding polling
Re: NSTask, NSFileHandle, readInBackgroundAndNotify and avoiding polling
- Subject: Re: NSTask, NSFileHandle, readInBackgroundAndNotify and avoiding polling
- From: Andreas Mayer <email@hidden>
- Date: Thu, 11 Jul 2002 14:36:37 +0200
Am Donnerstag den, 11. Juli 2002, um 05:41, schrieb Jim Correia:
Is there any way to convince NSFileHandle to only notify me when data
is actually available? (waitForDataInBackgroundAndNotify doesn't do the
trick, and the docs seem to indicate that readInBackgroundAndNotify is
implemented using it).
I'm not sure what's wrong with your code, but this is working for me:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(getData:) name:NSFileHandleReadCompletionNotification
object:portHandle];
[portHandle readInBackgroundAndNotify];
portHande is a *NSFileHandle;
bye. Andreas.
_______________________________________________
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.