宏
来源:互联网 发布:java发送邮件原理 编辑:程序博客网 时间:2024/05/16 10:26
//release屏蔽NSLog
//放在.pch文件里
#ifdef DEBUG
#else
#define NSLog(...) {};
#endif
//G。C。D
#define BACK(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define MAIN(block) dispatch_async(dispatch_get_main_queue(),block)
//Device
#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
谢谢16楼提出的 “判断Retina设备建议使用[[UIScreen mainScreen] scale]==2,不然横屏下那个宏定义判断的有问题 ”
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//区分模拟器和真机
#if TARGET_OS_IPHONE
//iPhone Device
#endif
#if TARGET_IPHONE_SIMULATOR
//iPhone Simulator
#endif
//ARC
#if __has_feature(objc_arc)
//compiling with ARC
#else
// compiling without ARC
#endif
//放在.pch文件里
#ifdef DEBUG
#else
#define NSLog(...) {};
#endif
//G。C。D
#define BACK(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define MAIN(block) dispatch_async(dispatch_get_main_queue(),block)
//Device
#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
谢谢16楼提出的 “判断Retina设备建议使用[[UIScreen mainScreen] scale]==2,不然横屏下那个宏定义判断的有问题 ”
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//区分模拟器和真机
#if TARGET_OS_IPHONE
//iPhone Device
#endif
#if TARGET_IPHONE_SIMULATOR
//iPhone Simulator
#endif
//ARC
#if __has_feature(objc_arc)
//compiling with ARC
#else
// compiling without ARC
#endif
0 0
- 宏
- 宏
- ##宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 宏
- 物业管理中水井房水表后面的水管是属于业主的物业吗
- python核心编程(二)第六章答案(自己写,可能与标准答案有些出入)
- 学步
- javaWeb-day01(程序的调试方法,配置快捷键)
- [iOS diary]UILabel对iOS6.0及以下的适配。UILabel在iOS6.0以下背景为白色,iOS7为透明
- 宏
- android 保存bitmap图片到sd卡中文件夹
- My SQL存储过程
- NN HA 对于 Client 透明的实验
- Android实现自带横线的EditText
- Fragment中startActivityForResult调转Activity时onActivityResult先执行等问题的解决方法
- hdu1800Flying to the Mars (字典树)
- Sublime Text2 中Emmet(之前叫Zencoding)插件安装以及使用 - jnpd
- Linux MySQL的卸载与安装!!!