现在的位置: 首页 > 综合 > 正文

runloop

2013年11月03日 ⁄ 综合 ⁄ 共 1230字 ⁄ 字号 评论关闭

runloop
Inherits from NSObject Conforms to NSObject (NSObject) Framework /System/Library/Frameworks/Foundation.framework Availability Available in iPhone OS 2.0 and later. Companion guide Threading Programming Guide Declared in NSRunLoop.h Related sample code CryptoExercise
HeadsUpUI Reachability TableViewSuite WiTap

Overview

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, NSPort objects, and NSConnection objects. An NSRunLoop object
also processes NSTimer events.

In general, your application does not need to either create or explicitly manage NSRunLoop objects. Each NSThread object, including the application’s main thread, has an NSRunLoop object automatically created for it as needed. If you need to access the current
thread’s run loop, you do so with the class method currentRunLoop.

Note that from the perspective of NSRunloop, NSTimer objects are not "input"—they are a special type, and one of the things that means is that they do not cause the run loop to return when they fire. !

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.

抱歉!评论已关闭.