- 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.
分析:該崩潰發(fā)于在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個數(shù)不一致
總結(jié):在使用reloadSections 方法的時候一定要小心,保證當前section內(nèi)的rows 前后一致,如果該section的rows是動態(tài)的,那么還是乖乖的用reloadData 刷新視圖,改方法會從新計算section 的個數(shù),以及相應(yīng)的rows
[self.tableView reloadData];
tableView的崩潰問題還挺多的,可以參考 開發(fā)中遇到的坑 里面提到的關(guān)于tableView 的一些崩潰問題;