- Your application has presented a UIAlertController (<UIAlertController: 0x13f454ac0>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
分析:该崩溃发于在ipad 上面
原因:使用了UIAlertController 的sheet 特性控件,在ipad上运行的时候
2. tableView 的reloadSections 刷新方法崩溃:
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationNone];
崩溃堆栈信息:
[UITableView(FDTemplateLayoutCellAutomaticallyCacheInvalidation) fd_reloadSections:withRowAnimation:] [UITableView+FDTemplateLayoutCell.m : 345]
Exception Name: NSInternalInconsistencyException
Exception Reason: Invalid update: invalid number of rows in section 3. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (3), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).
大概意思是说某个section 更新前后rows个数不一致
总结:在使用reloadSections 方法的时候一定要小心,保证当前section内的rows 前后一致,如果该section的rows是动态的,那么还是乖乖的用reloadData 刷新视图,改方法会从新计算section 的个数,以及相应的rows
[self.tableView reloadData];
tableView的崩溃问题还挺多的,可以参考 开发中遇到的坑 里面提到的关于tableView 的一些崩溃问题;