0

これは私のコードです:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  { 
     static NSString *CellIdentifier = @"simpleTable";
     profileCellViewController *cell = [self.myTable dequeueReusableCellWithIdentifier:CellIdentifier];   
        if (cell == nil)
        {
            NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"simpleTable" owner:self options:nil];
            cell = [nib objectAtIndex:0]; 
        }
  //loading data
   ...
   ...
   ...

     cell.name.text     = name;
     cell.time.text = time;
     cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
     return cell;
  }

問題が if (cell==nil) 部分にあることは知っていますが、これを解決できるかどうかは本当にわかりません...このviewcontrollerタブに戻るたびに、セルが複製されます

4

0 に答える 0