Important: The information in this document is superseded by the information in Threading Programming Guide. For information about how to configure a run loop for your custom threads, see that document instead.
When using an application built using the Application Kit, a run loop is created and run automatically. If you need to access this run loop, use the NSRunLoop class method currentRunLoop
.
Additional run loops are created for each additional NSThread and also can be accessed by invoking currentRunLoop
from each thread. These run loops do not have any input sources and are not running when the thread begins. You must add input sources to them and start the run loop yourself.
Warning: The NSRunLoop class is generally not considered to be thread-safe and its methods should only be called within the context of the current thread. You should never try to call the methods of an NSRunLoop object running in a different thread, as doing so might cause unexpected results.
© 2001, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)