程序调试、NSLog

调试程序

  • 调用堆栈
  • 视图层次结构 - 查看视图遮挡以及自动布局错误
  • 断点和 条件 断点
  • lldb
  • instrument:Time Profile/ Core Animation/ 内存泄漏

收集错误 —— bugly

* 官方网站 http://bugly.qq.com/

操作步骤

  • Pod
    pod 'Bugly'
    
  • 登录官方网站,注册 App
  • 在 application:didFinishLaunchingWithOptions:添加以下代码

      [[CrashReporter sharedInstance] setUserId:@"UserID"];
      [[CrashReporter sharedInstance] installWithAppId:@"AppID"];
    
  • 参考视频地址:http://www.jikexueyuan.com/course/534.html

NSLog

#ifdef __OBJC__

#ifdef DEBUG
#define NSLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define NSLog(...)
#endif

#endif
posted @ 2016-10-11 15:26  笔锋至此  阅读(120)  评论(0编辑  收藏  举报