简体   繁体   English

TableView单元格数据被覆盖

[英]TableView Cells data is override

I am getting data from Webservice call. 我正在从Webservice调用获取数据。 When I am getting the data from server first time UITableView cells data is good, but when I scroll table view then data is recreated. 当我第一次从服务器获取数据时, UITableView单元格数据很好,但是当我滚动表视图时,将重新创建数据。

What is the Solution for this? 解决方案是什么?

     check if cell is nil, as following 

  static NSString *CellIdentifier = @"id";

    YourCreatedCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

     if(cell == nil){

         NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"YourCreatedCell" owner:self options:nil];

         cell = [nib objectAtIndex:0];


      }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM