cell应该是在释放池中,也就是UITableView两个协议中必须实现的那个里面写,cell高度是跟随section而变得,如果想获得多个不同高度的section,就在协议中做判断,建立多个释放池,希望可以帮到你

解决方案 »

  1.   

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return 40.0f;
    }这个方法能修改cell的高度。
    另外, 如果cell高度不同。 可以不复用cell,如果数据不多的话。
      

  2.   

    UITableViewCell *myCell = [_tableView cellForRowAtIndexPath:indexPath];    //选取某个cellcellForRowAtIndexPath 返回的是一个UITableViewCell
      

  3.   

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:2 inSection:0];
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
    取出来的cell是nil,是不是tableview还没生成?这两行代码应该加在哪里?