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

      <small id='61aE8'></small><noframes id='61aE8'>

        <legend id='61aE8'><style id='61aE8'><dir id='61aE8'><q id='61aE8'></q></dir></style></legend>

        tableView:indexPathForCell 返回 nil

        tableView:indexPathForCell returns nil(tableView:indexPathForCell 返回 nil)
          <bdo id='1KCit'></bdo><ul id='1KCit'></ul>

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

        • <tfoot id='1KCit'></tfoot>

            <small id='1KCit'></small><noframes id='1KCit'>

              <tbody id='1KCit'></tbody>

                  <legend id='1KCit'><style id='1KCit'><dir id='1KCit'><q id='1KCit'></q></dir></style></legend>
                1. 本文介绍了tableView:indexPathForCell 返回 nil的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I am using the method tableView:indexPathForCell to implement a custom delegate that can dynamically resize a UITableViewCell based on the frame size of the UIWebView that is inside of it. The problem is that tableView:indexPathForCell is returning nil when I try to find out what the indexPath of a particular cell is:

                  - (void)trialSummaryTableViewCell:(TrialSummaryTableViewCell *)cell shouldAssignHeight:(CGFloat)newHeight {
                      NSIndexPath *indexPath = [tableV indexPathForCell:cell];
                      NSLog(@"tableV: %@
                  cell: %@
                  indexPath: %@", tableV, cell, indexPath); //<-- 
                      // ...
                  }
                  

                  Here, tableV does not return nil, cell does not return nil, but indexPath returns nil.

                  What am I doing wrong?

                  Edit: I am calling -(void)trialSummaryTableViewCell from the tableView:cellForRowAtIndexPath: method

                  解决方案

                  It could be that the cell is not visible at this moment. tableView:indexPathForCell returns nil in this situation. I solved this using indexPathForRowAtPoint this method works even if the cell is not visible. The code:

                  UITableViewCell *cell = textField.superview.superview;
                  NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];
                  

                  这篇关于tableView:indexPathForCell 返回 nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                  Mobile Device Management with iPhone(使用 iPhone 进行移动设备管理)

                      <legend id='cZf7t'><style id='cZf7t'><dir id='cZf7t'><q id='cZf7t'></q></dir></style></legend>

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

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