IOS开发中常用到的宏定义
来源:互联网 发布:局域网控制电脑软件 编辑:程序博客网 时间:2024/05/16 12:43
=====================================
//release屏蔽NSLog
//放在.pch文件里#ifdef DEBUG
#else
#define NSLog(...) {};
#endif
#ifdef DEBUG
#define WLog(...) NSLog(__VA_ARGS__)
#else
#define WLog(...)
#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)
=======================================
//系统版本
[[[UIDevice currentDevice] systemVersion] floatValue]
=================================
#define isRetina ([UIScreeninstancesRespondToSelect
#define iPhone5 ([UIScreeninstancesRespondToSelect
#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)
#else
#endif
#ifndef MB_STRONG
#if __has_feature(objc_arc)
#define MB_STRONG strong
#else
#define MB_STRONG retain
#endif
#endif
#ifndef MB_WEAK
#if __has_feature(objc_arc_weak)
#define MB_WEAK weak
#elif __has_feature(objc_arc)
#define MB_WEAK unsafe_unretained
#else
#define MB_WEAK assign
#endif
#endif
#if __has_feature(objc_arc)
#define MB_AUTORELEASE(exp) exp
#define MB_RELEASE(exp) exp
#define MB_RETAIN(exp) exp
#else
#define MB_AUTORELEASE(exp) [exp autorelease]
#define MB_RELEASE(exp) [exp release]
#define MB_RETAIN(exp) [exp retain]
#endif
=========================================
//block
#if NS_BLOCKS_AVAILABLE
typedef void (^MBProgressHUDCompletionBlock)();
#endif
====================================
- IOS开发中常用到的宏定义
- iOS开发中常用到的宏
- iOS开发中常用到的处理异常的宏 NSAssert()
- iOS开发项目中常用到的一些宏
- iOS开发中常用到的SQL语句
- iOS开发中常用到的加密方式
- iOS开发中常用到的参数
- iOS中常用到的全局变量
- iOS开发中常用到的SVN命令(持续更新)
- IOS开发中常用到的工具方法(时间方面)
- 开发中常用到的片段
- 两个开发中常用到的
- 开发中常用到的标签
- C 中常用到的宏
- C 中常用到的宏
- iOS中常用到的第三方框架
- ios中常用到的正则表达式
- SAP 开发中常用到的BAPI
- 将双系统中的ubuntu删除以后出现no such partition grub rescue的解决方案
- Eclipse搭配开发Jsp开发环境
- UI界面类项目:非UI界面类:(第三方)
- extjs4 中使用google地图api
- 如何解决java.library.path属性在代码中设置不生效问题
- IOS开发中常用到的宏定义
- hdu1501
- Linux grep命令
- 删除Oracle数据库时常见问题(注册表方面,文件目录方面,环境变量方面)
- Linux使用C读取文件目录
- hdu——poj2470—— Ambiguous permutations
- hdu 1013
- 动手写简单的嵌入式操作系统一
- DC_CheckWatchdog