Low-level details of the implementation of performSelectorOnMainThread:

后端 未结 4 1571
情歌与酒
情歌与酒 2021-02-06 07:13

Was wondering if anyone knows, or has pointers to good documentation that discusses, the low-level implementation details of Cocoa\'s \'performSelectorOnMainThread:\' method.

4条回答
  •  忘掉有多难
    2021-02-06 07:42

    As Mecki said, a more general mechanism that could be used to implement -performSelectorOn… is NSTimer.

    NSTimer is toll-free bridged to CFRunLoopTimer. An implementation of CFRunLoopTimer – although not necessarily the one actually used for normal processes in OS X – can be found in CFLite (open-source subset of CoreFoundation; package CF-476.14 in the Darwin 9.4 source code. (CF-476.15, corresponding to OS X 10.5.5, is not yet available.)

提交回复
热议问题