As @DarkDust suggests, he used to make timers. See Chris Kane's discussions on the Cocoa mailing list . At one point, runMode:beforeDate: was a wrapper around limitDateForMode: and acceptInputForMode:beforeDate: (since acceptInputForMode:beforeDate: did not start timers). My reading of documents, headers and crash stacks suggests that today they behave the same (calling CFRunLoopRunInMode() , which makes timers). But I did not create a test application for confirmation.
If you are reading the original NeXT ObjC manual , acceptInputForMode:beforeDate: used to explicitly disable the timers:
Blocks waiting for input from ports in the list of ports for input mode mode, up to the point specified by limitDate. Use the limitDateForMode: method to calculate limitDate. If the input arrives, it is processed using NSPort delegates. This method does not check the timers associated with the mode, so it does not start the timers, even if their planned fire dates have passed.
Timers were explicitly handled as a side effect of limitDateForMode:
Access sources in polling mode for their limit date (if any) and returns the earliest limit date for this mode. Uses the NSPort limitDateForMode: delegate method to determine port limit dates. Starts timers if their deadlines have passed. Port polls for activities appropriate for the mode. Returns zero if there are no input sources for this mode.
This is why runMode:beforeDate: was added as a convenience (see NSRunloop.h ):
@interface NSRunLoop (NSRunLoopConveniences) - (void)run; - (void)runUntilDate:(NSDate *)limitDate; - (BOOL)runMode:(NSString *)mode beforeDate:(NSDate *)limitDate;
See also from NeXT:
The limitDateForMode method: returns the earliest limit date of all input sources for the NSDefaultRunLoopMode mode. acceptInputForMode: beforeDate: starts the loop until this date, processing any input it receives before this time. For convenience, you can use runMode: beforeDate: instead. It calls acceptInputForMode: beforeDate: and limitDateForMode: with the mode you provide.
So the short answer is: history.
source share