ios – 在两部分搜索时崩溃

我有一个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

有趣的是,如果我只有一个部分,它的工作完美.

请帮助!

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...