一、在开发中如何调试程序?使用过哪些调试工具?
》调用堆栈: 从下到上执行。
》视图层次结构—查看视图遮挡以及自动布局错误
》断点和 条件断点
》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"];
三、NSLog
创建一个pch文件---->配置pch文件。在pch文件中拷贝下面内容即可
#ifdef __OBJC__
#ifdef DEBUG#define NSLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define NSLog(...)
#endif
#endif