zoukankan      html  css  js  c++  java
  • 自己常用的宏(遇到添加)

    1.屏幕宽度屏幕高度

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

    #define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height

    2.获取随机颜色

    #define RRRandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0]

    3.颜色

    #define RRColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

    #define RRALPHAColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:a]

    #define RRClearColor [UIColor clearColor]

    4.Log

    RRLog(...) NSLog(@"%s 第%d行 %@ ",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])

    5.判空

    //是否为空或是[NSNull null]

    #define NotNilAndNull(_ref) (((_ref) != nil) && (![(_ref) isEqual:[NSNull null]]))

    #define IsNilOrNull(_ref) (((_ref) == nil) || ([(_ref) isEqual:[NSNull null]]))

    //字符串是否为空

    #define IsStrEmpty(_ref) (((_ref) == nil) || ([(_ref) isEqual:[NSNull null]]) ||([(_ref)isEqualToString:@""]) ||([(_ref)isEqualToString:@"(null)"]))

    //数组是否为空

    #define IsArrEmpty(_ref) (((_ref) == nil) || ([(_ref) isEqual:[NSNull null]]) ||([(_ref) count] == 0))

    #define IsNumberEmpty(_ref) ((_ref) == nil) || ((_ref).floatValue == 0)

  • 相关阅读:
    servlet的提交
    servlet的doPost 和doGet和web文件结构
    helloServlet
    捕鱼达人
    The 2018 ACM-ICPC China JiangSu Provincial Programming Contest I. T-shirt
    ACM-ICPC 2017 Asia Urumqi A. Coins
    Nordic Collegiate Programming Contest 2015​ B. Bell Ringing
    变量
    hiho 1050 树的直径
    ACM-ICPC 2017 Asia Urumqi G. The Mountain
  • 原文地址:https://www.cnblogs.com/huoran1120/p/5773520.html
Copyright © 2011-2022 走看看