NSRunLoop processing order of NSPort delegates
NSRunLoop processing order of NSPort delegates
- Subject: NSRunLoop processing order of NSPort delegates
- From: Leigh Smith <email@hidden>
- Date: Mon, 21 May 2001 12:02:29 -0400
Unfortunately I didn't get an answer on macosx-dev@omnigroup to this, so
hopefully asking here will get closer to those who can examine the source
code.
According to the NSRunLoop documentation for acceptInputForMode:beforeDate:
"Blocks awaiting input from the ports in the port list for the input mode
mode until the time specified by limitDate. Use the limitDateForMode:
method to calculate limitDate. If input arrives, it is processed using the
NSPort delegates. This method does not check the timers associated with
mode, thus it does not fire timers even if their scheduled fire dates have
passed."
However I'm finding that on receipt of a message (via an NSConnection) on
a monitored port, NSRunLoop will exit acceptInputForMode:beforeDate: or
runMode:beforeDate: *before* the delegate method is called, i.e two
iterations of acceptInputForMode: is needed to actually call the method.
If my reading of the documentation is correct, the delegate method should
be called ("If input arrives, it is processed using the NSPort delegates"),
then acceptInputForMode: should complete.
Can anyone confirm, deny or explain this?
--
Dr. Leigh Smith, Ph.D
tomandandy
mailto:email@hidden
http://www.tomandandy.com