ksnowlv

回顾过去,总结以往;立足现在,铭记当下;技术为主,笔记而已.

iOS下常用调试方法

| Comments

1.预编译器内置的宏可用于c/c++/Objective-C

  • __func__ :当前函数名

  • __LINE__ :当前代码行号

  • __FILE__ :文件名

  • __PRETTY_FUNCTION__ :当前函数名

2.在Objective-C中常用的表达式

  • NSStringFromSelector(_cmd) :当前selector
  • NSStringFromClass : class名
  • [NSThread callStackSymbols] : 线程调用栈

_cmdobjective-c的方法中内置的变量。

3.常用日志函数

  • NSLog
  • print

Comments

comments powered by Disqus
Included file 'custom/after_footer.html' not found in _includes directory