V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
georgetso
V2EX  ›  iDev

NSRunLoopMode 为什么只有两个?

  •  
  •   georgetso · 2015-02-05 16:55:27 +08:00 · 3052 次点击
    这是一个创建于 3339 天前的主题,其中的信息可能已经有所发展或是发生改变。
    文档里只定义了

    extern NSString* const NSDefaultRunLoopMode ;
    extern NSString* const NSRunLoopCommonModes;

    但是 Programming Guide 里提到了五种

    NSDefaultRunLoopMode
    NSConnectionReplyMode
    NSModalPanelRunLoopMode
    NSEventTrackingRunLoopMode
    NSRunLoopCommonModes

    咋回事儿啊?
    6 条回复    2015-02-05 17:45:42 +08:00
    danny106
        1
    danny106  
       2015-02-05 17:13:39 +08:00
    只能说所有的定义没有放在同一个头文件
    georgetso
        2
    georgetso  
    OP
       2015-02-05 17:23:01 +08:00
    @danny106 xcode文档里搜索不到其他定义(除了programming guide外)
    anerevol
        3
    anerevol  
       2015-02-05 17:27:10 +08:00
    NSRunLoopCommonModes不是一种模式,是一组模式集合吧。
    georgetso
        4
    georgetso  
    OP
       2015-02-05 17:35:12 +08:00
    @anerevol 如果只定义了两个,那组合啥?
    lldong
        5
    lldong  
       2015-02-05 17:40:38 +08:00
    因为上面有些是在 Mac 上的 AppKit 里面定义的
    anerevol
        6
    anerevol  
       2015-02-05 17:45:42 +08:00
    好像可以自己随便定义的。
    https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html
    You can add custom modes to the set using the CFRunLoopAddCommonMode function.

    之前稍微看了下, 写了点自己的理解,http://anerevol.github.io/ios/2014/07/11/RunLoop%E7%AE%80%E4%BB%8B/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1214 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:10 · PVG 02:10 · LAX 11:10 · JFK 14:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.