宏的定义:
#define BookContentContainerViewCornerRadius 4.0 #define BookContentContainerViewCornerRadius @"yushuyi"
在宏里面同样可以执行代码:
#define BookContentContainerViewCornerRadius 1+1
使用宏编写IF ELSE 语句语法:
#if YES //Code #else //Code #endif
1:UI_USER_INTERFACE_IDIOM()
功能:判断运行当前应用的设备是iPhone 还是 iPad
返回: UIUserInterfaceIdiom 枚举值
2: TARGET_IPHONE_SIMULATOR
功能:判断当前运行环境是否是模拟器
返回:YES 表示 是模拟器, NO表示不是模拟器