zoukankan      html  css  js  c++  java
  • iOS 调试用Log()与随机颜色设置

    Pch文件内添加:

    1.Log()设置:

    #ifdef DEBUG // 调试阶段
    #define CHLog(...) NSLog(@"%s %d
     %@", __func__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
    #else // 发布阶段
    #define CHLog(...) 
    #endif

    如果嫌打印太多可设置为:

    #define CHLog(...) NSLog(__VA_ARGS__)

    2.随机颜色设置:

    #define CHColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
    
    // 随机颜色
    #define CHRandomColor CHColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))
  • 相关阅读:
    Linux Netcat命令
    clang-format
    keytool
    ip
    Linux iptables
    Linux yum源完全配置
    Makefile
    CMake
    HSTS
    开源镜像
  • 原文地址:https://www.cnblogs.com/happyplane/p/4713909.html
Copyright © 2011-2022 走看看