iOS中的Availability.h头文件

来源:互联网 发布:越南人 知乎 编辑:程序博客网 时间:2024/06/05 07:38

在预编译文件:prefix.pch中


#import <Availability.h>#ifndef __IPHONE_5_0#warning "This project uses features only available in iOS SDK 5.0 and later."#endif#ifdef __OBJC__    #import <UIKit/UIKit.h>    #import <Foundation/Foundation.h>#endif#ifdef DEBUG#define NSLog(...) NSLog(__VA_ARGS__)#define debugMethod() NSLog(@"%s", __func__)#else#define NSLog(...)#define debugMethod()#endif

有一个头文件:Availability.h,这个头文件的作用是判断iOS系统的版本可用性。