Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios TableView单元格数据被覆盖_Ios_Uitableview - Fatal编程技术网

Ios TableView单元格数据被覆盖

Ios TableView单元格数据被覆盖,ios,uitableview,Ios,Uitableview,我正在从Webservice调用获取数据。当我第一次从服务器获取数据时,UITableViewcells数据是良好的,但当我滚动表格视图时,数据被重新创建 解决这个问题的方法是什么?请输入一些代码。为了使您的问题更清楚易懂,请添加一些代码 check if cell is nil, as following static NSString *CellIdentifier = @"id"; YourCreatedCell *cell = [tableView deque

我正在从Webservice调用获取数据。当我第一次从服务器获取数据时,
UITableView
cells数据是良好的,但当我滚动表格视图时,数据被重新创建


解决这个问题的方法是什么?

请输入一些代码。为了使您的问题更清楚易懂,请添加一些代码
     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];


      }