nslog一些用法

1.nslog打印方法出来

NSLog(@"%@",NSStringFromSelector(_cmd));

2.debug模式下打印一些信息,release模式下则不打印

#if DEBUG

    #define NSLog(FORMAT, ...) fprintf(stderr," function:%s line:%d content:%s ", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);

    #else

    #define NSLog(FORMAT, ...) nil

    #endif

原文地址:https://www.cnblogs.com/wskgjmhh/p/4935120.html