zoukankan      html  css  js  c++  java
  • iOS

    >for 'dispatch' application inner to begin note

    `#include <Availability.h>`

    These macros are for use in OS header files. They enable funcation prototypes and Objective-C methods to be tagged with the OS version in which they were first available; and, if applicable, the OS version in which they beacom deprecated.

    Examples (_NA: not applicable):

    __OSX_AVAILABLE_STARING(__MAC_10_2,__IPHONE_2_0)

    __OSX_AVALIABLE_STARING(__MAC_10_2,__IPHONE_NA)   

    __OSX_AVALIABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_5,__IPHONE_5_0,__IPHONE_8_0)

    __OSX_AVALIABLE_BUT_DEPERCATED(__MAC_10_2,__MAC_10_5,__IPHONE_NA,__IPHONE_NA)

    For these macros to funcation properly, a program must specify the OS version range it is targeting. the min OS version is specified as an option to the compiler: -mmacosx-version-min=10.x when building for Mac OS X, and -miphoneos-version-min=y.z when building for the iPhone. 

    Examples:

    __OSX_AVAILABLE_STARING(__MAC_10_5,__IPHONE_NA);

    #if __IPHONE_OS_VERSION_MIN_REQUIRED // this macros avliable in iPhoneOS Only

    enum{

      myX = 1,   // Usable on iPhoneOS 2.1 and later

      myY = 2,   // Usable on iPhoneOS 2.0 and later

      myZ = 3,   // Usable on iPhoneOS 3.0 and later

      ...

    }

    #endif

    These macros

    ```

    /*! MACOS-X version*/

    #define __MAC_10_0            1000

    #define __MAC_10_1            1010

    ...

    #define __MAC_10_11_4       101104

    /*! iPhoneOS version*/

    #define __IPHONE_2_0      20000

    #define __IPHONE_2_1      20100

    ...

    #define __IPHONE_9_3      90300

    /*! TVOS version*/

    #define __TVOS_9_0        90000

    #define __TVOS_9_1        90100

    #define __TVOS_9_2        90200

     /*! WATCHOS version*/

    #define __WATCHOS_1_0     10000

    #define __WATCHOS_2_0     20000

    ```

  • 相关阅读:
    智能指针的理解
    [转] weak_ptr解决shared_ptr环状引用所引起的内存泄漏
    模板实现多态的功能
    Protobuf的自动反射消息类型的方法
    [转] C++临时变量的生命周期
    C++转换函数
    [转] boost------ref的使用(Boost程序库完全开发指南)读书笔记
    c++回调编程本质
    New 和 GetMem 的不同之处
    Delphi New,Getmem,ReallocMem联系与区别
  • 原文地址:https://www.cnblogs.com/R0SS/p/5123093.html
Copyright © 2011-2022 走看看