我有一个NSFetchedResultController
不同的部分。当我尝试使用搜索时发生崩溃UISearchDisplayController
:
*** Assertion failure in -[UITableViewRowData rectForRow:inSection:], /SourceCache/UIKit/UIKit-2372/UITableViewRowData.m:1630
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect at invalid index path (<NSIndexPath 0x1d2c4120> 2 indexes [0, 1])'
我检查了一下,我的搜索数组确实有两个条目(预期结果):
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
它返回 1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
它返回 2
有趣的是,如果我只有一个部分,它就可以完美运行。
请帮忙!:)