// 直接从RGB取颜色(RGB 0xFF00FF)
#define UICOLOR_FROM_RGB(rgbValue) \
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//获取当前屏幕尺寸
#define APP_HEIGHT [UIScreen mainScreen].applicationFrame.size.height
#define SCR_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCR_WIDTH [UIScreen mainScreen].bounds.size.width
/**
[宏函数]仅仅执行一回,但里面有一个for循环,可以执行些其他的操作
loops --> 循环的次数
label --> 变量的名字(该变量为static int型号)
block --> 一个能传参数进去的block,传进去的参数为value
使用示例(仅仅执行一回,但循环4次)
EXECUTE_ONCE_FOR_SOME_LOOPS(4, labelName, labelName:^(int value){
});
*/
#define EXECUTE_ONCE_FOR_SOME_LOOPS(loops, label, block) \
static int label = 0;\
for(; label < loops; label++){\
block(label);\
}
// 系统子线程池(并发执行)
#define SYS_CONCURRENT_QUEUE_H dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)
#define SYS_CONCURRENT_QUEUE_D dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
#define SYS_CONCURRENT_QUEUE_L dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)
#define SYS_CONCURRENT_QUEUE_B dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)
// 系统主线程池(序列执行)
#define SYS_SERIAL_QUEUE dispatch_get_main_queue()
#define SYS_UI_QUEUE dispatch_get_main_queue()
//沙盒路径
#define SANDBOX_PATH NSHomeDirectory()