これは私の cellForRowAtIndexPath コードです:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"MonthViewPopUpCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nibObjcet = [[NSBundle mainBundle] loadNibNamed:@"MonthViewPopUpCell" owner:self options:nil];
cell = [nibObjcet objectAtIndex:0];
cellTitle.font = [UIFont fontWithName:fontB size:size4];
cellSubtitle.font = [UIFont fontWithName:fontR size:size4];
}
if (indexPath.row == 0) {
cellTitle.text = @"11:03";
}
return cell;
}
なんらかの理由で、テーブルビューがカスタム セルを間違って再利用します。このコードにより、最初のセルが 11:03 に表示され、残りはすべて 10:00 に表示されると思いましたが (xib ファイルのように)、他のセルにも 11:03 が表示され、スクロールすると位置が変化します。狂ったように上下...
誰かが私が間違ったことを教えてもらえますか?
ありがとう