1、基础断点
通过打基础断点,判断运行程序,是否走了某一方法等
2、全局断点
程序crash,会断点到你有问题的代码那一行
3、NSLog
打印数据,进行分析程序问题
4、视图调试
查看图层
5、点击product-->Analyze(分析)
进行编译代码,列出所有编码错误的地方
1、Localizability Issue (Apple) 可本地化问题
这种问题可以忽略
解决方法:在 Build Settings 里面找到 Missing Localizability(缺少本地化) 设置为NO,就会忽略这个问题啦, 或者 , 你也可以在应用里面进行本地化。
2、Dead store
无效数据: 意思就是有一些属性或者对象初始化了又没被使用
3、Logic error 逻辑错误
Converting a pointer value of type 'NSNumber *' to a primitive boolean value;instead,either compare the pointer to nil or call -boolValue(将类型为“NSNumber *”的指针值转换为原始布尔值; 相反,要么将指针与nil进行比较,要么调用-boolValue)
nsnumber *str;
if(!str)
问题:使用NSNumber作为判断条件的时候,没有指定类型,编译器不知道怎么判断
解决办法:指定 NSNumber 对象与 nil 进行比较
if(str != nil)
4、Memory error 内存错误
nil passed to a callee that requires a non-null 1st parameter(nil传递给需要非null第一个参数的被调用者)
解决办法:通常这种情况下,只需要添加一个非空判断,保证传入的参数不为空即可
5、Core Foundation/Objective-C
1.假设条件不成立

2.在未设置为'[(超级或自我)初始化...]的结果时返回“自我”

解决办法:
去掉一个“=” 号,或者把 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 提出来放 if 条件前面
6、点product —>Profile-->instruments
网友评论