//获取屏幕的宽度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
//判断时iPhone几
#define kDoubleMargin 0.00001
#define IPHON4 (kScreenWidth > 320-kDoubleMargin && kScreenWidth < 320+kDoubleMargin && kScreenHeight<480+kDoubleMargin)
#define IPHONE5 (kScreenWidth > 320-kDoubleMargin && kScreenWidth < 320+kDoubleMargin && kScreenHeight>480+kDoubleMargin)
#define IPHONE6 (kScreenWidth > 375-kDoubleMargin && kScreenWidth < 375+kDoubleMargin)
#define IPHONE6PLUS (kScreenWidth > 414-kDoubleMargin && kScreenWidth < 414+kDoubleMargin)
#define IPAD_AIR ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad))
原文地址:http://blog.csdn.net/lu_ca/article/details/46376331