bug1:加载相关新闻时出现bug会闪退
报错原因为:
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
报错原因是因为布局冲突:
该bug是在添加底部控件时出现,由于底下的控件有七八个,所以采用逐一排查的方法,通过取消某控件的加载进行排除,最后发现是在加载相关新闻的uitableview时出现的冲突,检查发现我是使用xib建立的cell,控件是通过拉线建立的,解决方法是由拉线改为手写控件,冲突解决;
bug2:修复以上问题后,还是闪退,不过报错信息改为了
Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
该bug是由于之前修复上述功能时带入的,报错信息很简单,返回了空的cell
即
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
这个函数的返回值是个null!!
修复也很简单,去掉空的cell即可
拓展1:
在查找资料时遇到某个类似的bug,Assertion failure in -[UITableView _endCellAnimationsWithContext:]
解决方案请看http://blog.sina.com.cn/s/blog_7b9d64af0101b6se.html