防止重用方法一:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
替换为:
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //根据indexPath准确地取出一行,而不是从cell重用队列中取出
防止重用方法二:
static NSString* cellIdentifier = @"cell";
替换为:
NSString *cellIdentifier = [NSString stringWithFormat:@"Cell%ld%ld", (long)[indexPath section], (long)[indexPath row]];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
替换为:
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //根据indexPath准确地取出一行,而不是从cell重用队列中取出
防止重用方法二:
static NSString* cellIdentifier = @"cell";
替换为:
NSString *cellIdentifier = [NSString stringWithFormat:@"Cell%ld%ld", (long)[indexPath section], (long)[indexPath row]];