Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSRunLoop processing order of NSPort delegates



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.