Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

NSRunLoop

Inherits From: NSObject

Conforms To: NSObject (NSObject)

Declared In: Foundation/NSRunLoop.h

Class Description

The NSRunLoop class declares the programmatic interface to objects that manage input sources. An NSRunLoop object processes input for sources such as mouse and keyboard events from the window system, NSTimers, POSIX file descriptors, and NSConnections, based on a mode argument. A given NSRunLoop object processes input for input sources associated with a particular mode.

In general, your application won't need to either create or explicitly manage NSRunLoop objects. Each thread has an NSRunLoop object automatically created for it. The NSApplication object creates a default thread and therefore creates a default run loop.

Applications wanting to perform their own explicit run loop management should send the currentRunLoop message to the NSRunLoop class object to obtain the NSRunLoop object for the current thread, then invoke one of the methods described below in Running a Run Loop to obtain input.

Currently defined modes are:

NSDefaultRunLoopMode Use this mode to deal with input sources other than NSConnections. Defined in the Foundation/NSRunLoop.h header file.

NSConnectionReplyMode Use this mode to indicate NSConnections waiting for replies. Defined in the Foundation/NSConnection.h header file.

Accessing the Current Run Loop

Adding Timers

Running a Run Loop