【发布时间】:2011-12-25 09:13:35
【问题描述】:
我正在 xcode 4.2 中使用 UISearchDisplayController 实现 UITableView。 UITableView 和 UISearchDisplayController 在 StoryBoard 中创建。 我为 UITableView 设置单元格标识符(SampleCell)并像访问它一样
cell = [tableView dequeueReusableCellWithIdentifier:@"SampleCell"];
UItableView 工作正常。 但是一旦我尝试搜索,应用程序就会崩溃并出现以下错误。
*** Assertion failure in -[UISearchResultsTableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:6072
2011-11-09 22:22:16.058 SampleApp[14362:fb03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
我想我需要为 self.searchDisplayController.searchResultsTableView 单元格设置单元格标识符。 但我不知道怎么做。 提前感谢您的帮助。 =)
【问题讨论】:
-
+1 为你节省了我输入问题的时间。我遇到了完全相同的问题。
标签: ios5 uitableview xcode4.2 uisearchdisplaycontroller