CoreDataとカスタムセルを備えたTableViewがあり、すべて正常に機能します。
UINavigationControllerの戻るボタンをタップするだけで、コンテンツを編集してそこから戻るセルを選択すると、何か奇妙なことが起こります。
私が言っている画像を見てください。更新されたUILabelは、「更新」されるのではなく、古いものの上に配置されているようです。私は何か見落としてますか??
一番上のセルに違いがありますが、それはすべてのセルに起こります。
編集:コードを追加
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
customCell = [_mainTableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
if (customCell == nil)
{
customCell = [[MNCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
CGRect frameTitle;
frameTitle = CGRectMake(20, 4, 195, 21);
CGRect frameSummary;
frameSummary = CGRectMake(20, 25, 250, 30);
CGRect frameDate;
frameDate = CGRectMake(200, 4, 100, 21);
MNotes *mnotes = [[self fetchedResultsController] objectAtIndexPath:indexPath];
//Strings for Title and Summary
titleString = mnotes.noteTitleString;
summaryString = mnotes.mainNoteString;
NSLog(@"TITLE STRING = %@", titleString);
//Date
SORelativeDateTransformer *relativeDateTransformer = [[SORelativeDateTransformer alloc] init];
relativeDate = [relativeDateTransformer transformedValue:mnotes.createDate];
customCell.noteTitle = [[UILabel alloc] initWithFrame:frameTitle];
customCell.noteTitle.backgroundColor = [UIColor clearColor];
customCell.noteTitle.font = [UIFont systemFontOfSize:20];
customCell.noteTitle.userInteractionEnabled = NO;
customCell.noteTitle.textColor = [self colorWithHexString:@"274D70"];
customCell.noteSummary = [[UITextView alloc] initWithFrame:frameSummary];
customCell.noteSummary.backgroundColor = [UIColor clearColor];
customCell.noteSummary.font = [UIFont systemFontOfSize:10];
customCell.noteSummary.userInteractionEnabled = NO;
customCell.noteDate = [[UILabel alloc] initWithFrame:frameDate];
customCell.noteDate.backgroundColor = [UIColor clearColor];
customCell.noteDate.font = [UIFont systemFontOfSize:16];
customCell.noteDate.userInteractionEnabled = NO;
customCell.noteDate.textColor = [self colorWithHexString:@"274D70"]; //#274D70
}
customCell.noteTitle.text = titleString;
customCell.noteSummary.text = summaryString;
customCell.noteDate.text = relativeDate;
[customCell.contentView addSubview:customCell.noteTitle];
[customCell.contentView addSubview:customCell.noteSummary];
[customCell.contentView addSubview:customCell.noteDate];
return customCell;
}