< Previous PageNext Page > Hide TOC

Legacy Documentclose button

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.


Getting the Run Loop

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.



< Previous PageNext Page > Hide TOC


© 2001, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.