IOS开发常用宏定义
2013-12-12 13:49
302 查看
//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)
#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)
#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
相关文章推荐
- iOS 开发常用宏定义总结
- IOS开发中常用的单例模式宏定义
- iOS 开发常用宏定义
- iOS开发 常用宏定义
- IOS开发常用宏定义的总结
- iOS开发常用的宏定义
- IOS开发学习常用宏定义
- ios开发之不能抛弃的常用宏定义
- iOS-为方便项目开发在pch添加一些常用宏定义
- iOS开发常用的全局宏定义
- IOS开发中 常用的宏定义[陆续更新]
- iOS开发中常用宏定义
- iOS之 开发常用到的宏定义
- iOS开发常用宏定义
- ios开发常用的宏定义
- IOS开发之----常用宏定义和讲解_IOS-Coding_新浪博客
- ios开发--常用宏定义(部分转)
- iOS开发常用宏定义
- iOS开发中常用宏定义
- IOS开发常用宏定义