我在xcode 4.2中使用UISearchDisplayController实现了一个UITableView.UITableView和UISearchDisplayController是在StoryBoard中创建的.我为UITableView设置了Cell Identifier(SampleCell)并像访问它一样
cell = [tableView dequeueReusableCellWithIdentifier:@"SampleCell"];
Run Code Online (Sandbox Code Playgroud)
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:'
Run Code Online (Sandbox Code Playgroud)
我想我需要为self.searchDisplayController.searchResultsTableView单元格设置单元格标识符.但我不知道怎么做.在此先感谢您的帮助.=)