NSLog the method name with Objective-C in iPhone

前端 未结 6 2088
自闭症患者
自闭症患者 2020-12-07 07:09

Currently, we are defining ourselves an extended log mechanism to print out the class name and the source line number of the log.

#define NCLog(s, ...) NSLo         


        
6条回答
  •  遥遥无期
    2020-12-07 07:31

    It's actually just as simple as:

    printf(_cmd);
    

    For some reason iOS allows _cmd to be passed as a literal char with not even a compile warning. Who knows

提交回复
热议问题