<i id='tlyWZ'><tr id='tlyWZ'><dt id='tlyWZ'><q id='tlyWZ'><span id='tlyWZ'><b id='tlyWZ'><form id='tlyWZ'><ins id='tlyWZ'></ins><ul id='tlyWZ'></ul><sub id='tlyWZ'></sub></form><legend id='tlyWZ'></legend><bdo id='tlyWZ'><pre id='tlyWZ'><center id='tlyWZ'></center></pre></bdo></b><th id='tlyWZ'></th></span></q></dt></tr></i><div id='tlyWZ'><tfoot id='tlyWZ'></tfoot><dl id='tlyWZ'><fieldset id='tlyWZ'></fieldset></dl></div>
  • <legend id='tlyWZ'><style id='tlyWZ'><dir id='tlyWZ'><q id='tlyWZ'></q></dir></style></legend>
  • <small id='tlyWZ'></small><noframes id='tlyWZ'>

      <bdo id='tlyWZ'></bdo><ul id='tlyWZ'></ul>

        <tfoot id='tlyWZ'></tfoot>

        ios 5 UISearchDisplayController 崩溃

        时间:2023-05-31

        • <i id='Ubo91'><tr id='Ubo91'><dt id='Ubo91'><q id='Ubo91'><span id='Ubo91'><b id='Ubo91'><form id='Ubo91'><ins id='Ubo91'></ins><ul id='Ubo91'></ul><sub id='Ubo91'></sub></form><legend id='Ubo91'></legend><bdo id='Ubo91'><pre id='Ubo91'><center id='Ubo91'></center></pre></bdo></b><th id='Ubo91'></th></span></q></dt></tr></i><div id='Ubo91'><tfoot id='Ubo91'></tfoot><dl id='Ubo91'><fieldset id='Ubo91'></fieldset></dl></div>
          <legend id='Ubo91'><style id='Ubo91'><dir id='Ubo91'><q id='Ubo91'></q></dir></style></legend>
              <tbody id='Ubo91'></tbody>

              <small id='Ubo91'></small><noframes id='Ubo91'>

              • <bdo id='Ubo91'></bdo><ul id='Ubo91'></ul>
                <tfoot id='Ubo91'></tfoot>

                  本文介绍了ios 5 UISearchDisplayController 崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在 xcode 4.2 中使用 UISearchDisplayController 实现 UITableView.UITableView &UISearchDisplayController 是在 StoryBoard 中创建的.我为 UITableView 设置单元格标识符(SampleCell)并像访问它一样

                  I am implementing a UITableView with UISearchDisplayController in xcode 4.2. UITableView & UISearchDisplayController are created in StoryBoard. I set the Cell Identifier (SampleCell) for UITableView and access it like

                  cell = [tableView dequeueReusableCellWithIdentifier:@"SampleCell"];
                  

                  UItableView 工作正常.但是一旦我尝试搜索,应用程序就会崩溃并出现以下错误.

                  UItableView is working fine. But once i try to search, the app crash with below error.

                  *** 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 单元格设置单元格标识符.但我不知道怎么做.提前感谢您的帮助.=)

                  I guess I need to set the cell identifier for self.searchDisplayController.searchResultsTableView cell. But I don't know how. Thanks in advance for any help. =)

                  推荐答案

                  使用[self.tableView dequeue...],而不是[tableView dequeue...].

                  您尝试出列的单元格链接到情节提要中主视图控制器的 tableView,而不是 searchDisplayController 新创建的 tableView (没有链接到它的单元格标识符).如果您只是发送消息tableView",那么您的出队消息将发送到 searchDisplayController's tableView,因为这是传递给 cellForRowAtIndexPath:... 方法的内容.

                  The cell you're trying to dequeue is linked to your primary view controller's tableView in the storyboard, NOT the searchDisplayController's newly created tableView (which has no cell identifiers linked to it). If you just message "tableView" then your dequeue message goes to the searchDisplayController's tableView since that's what was passed into the cellForRowAtIndexPath:... method.

                  -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
                  {
                      UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"CellId"];
                  
                      // do your thing
                  
                      return cell;
                  }
                  

                  这篇关于ios 5 UISearchDisplayController 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Xcode 4.2 在 IB 的选项卡栏上放置导航控制器时的警 下一篇:如何隐藏&amp;在 SplitView 控制器中取消隐藏主视

                  相关文章

                  最新文章

                1. <legend id='goHyt'><style id='goHyt'><dir id='goHyt'><q id='goHyt'></q></dir></style></legend>

                  1. <small id='goHyt'></small><noframes id='goHyt'>

                      <i id='goHyt'><tr id='goHyt'><dt id='goHyt'><q id='goHyt'><span id='goHyt'><b id='goHyt'><form id='goHyt'><ins id='goHyt'></ins><ul id='goHyt'></ul><sub id='goHyt'></sub></form><legend id='goHyt'></legend><bdo id='goHyt'><pre id='goHyt'><center id='goHyt'></center></pre></bdo></b><th id='goHyt'></th></span></q></dt></tr></i><div id='goHyt'><tfoot id='goHyt'></tfoot><dl id='goHyt'><fieldset id='goHyt'></fieldset></dl></div>
                      <tfoot id='goHyt'></tfoot>
                        <bdo id='goHyt'></bdo><ul id='goHyt'></ul>