zoukankan      html  css  js  c++  java
  • iOS 常用的宏

    /* -------- 屏幕宽高 -------- */

    #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)

    #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

    /* -------- 打印日志 -------- */

    #ifdef DEBUG

    #define NSLog(FORMAT, ...) fprintf(stderr," %s:%d %s ",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);

    #else

    #define NSLog(...)

    #endif

    /* -------- 系统版本 -------- */

    #define IS_IOS7  ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 )

    #define IS_IOS8  ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 )

    #define IS_IOS9  ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 )

    /* -------- 颜色 -------- */

    #define UICOLOR_RGB(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]

    #define UICOLOR_RANDOM  [UIColor colorWithRed:(arc4random()%255)/255.0 green:(arc4random()%255)/255.0 blue:(arc4random()%255)/255.0 alpha:1.0]

    /* -------- 真机模拟器 -------- */

    #if TARGET_OS_IPHONE

    // iPhone Device

    #endif

    #if TARGET_IPHONE_SIMULATOR

    // iPhone Simulator

    #endif

  • 相关阅读:
    RramSim2
    DiskSim
    FTL2
    Durable NAND flash memory management
    node系列:全局与本地
    CSS系列:less备忘
    Sql Server 2008:调试
    JavaScript系列:再巩固-原型链
    移动端 :meta标签1万个作用
    Asp.Net:Repeater 详情 备用
  • 原文地址:https://www.cnblogs.com/chenyanliang/p/9679182.html
Copyright © 2011-2022 走看看