iOS:系统宏说明(持续更新)

__OBJC__:

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

It means the objective C compiler is being used. So you can create hybrid header files that can be used when compiling objective C or C or C++.
或者This would be the case if you were developing an objective-c / cocoa application. In other words, if you were developing a C++ / carbon application, the OBJC symbol would not be defined and those objective-c dependant frameworks would not be imported.

__has_feature:某些特性验证

#if !__has_feature(objc_arc)
#error This library requires automatic reference counting
#endif

NS_AVAILABLE_IOS(ios)

告诉在ios及以后的版本使用,更老版本不能使用;
类似:NS_AVAILABLE(_mac, _ios) 共用的方法

NS_DEPRECATED_IOS(_iosIntro,_iosDep, …)

_iosIntro表示方法引入时iOS版本,_iosDep表示方法废弃时iOS版本;第三个参数是message意思;
类似;NS_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, …)
类似:__TVOS_PROHIBITED不可用或者__TVOS_UNAVAILABLE不可用或者__TVOS_AVAILABLE(_vers) 或者__TVOS_DEPRECATED(_start, _dep, _msg) 同样的 watchOS类似;

__IPHONE_OS_VERSION_MIN_REQUIRED

这个取值来源于deployment target;
__IPHONE_OS_VERSION_MAX_ALLOWEDQ取值来源于你的base sdk值;俩个值主要用在不同版本api适配上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值