重新刷洗数据需求更新全部数据,因为上一次的cell缓存池还存在,导致刷新出来的cell还是取得原来的cell缓存池,数据格式不正确。
**解决办法:每次进来cellforrow的时候会执行加入缓存池,在这里标识一个变化的indentifier
1、通过不同的Identifier标识不同的cell,适用于显示不同类型的cell,让其去缓存池中根据Indentifier查找cell。
NSString *youcellID = [NSString stringWithFormat:@"cell_%@_%@",youdatesource.property1,youdatesource.property1];
yourCell = [tableView dequeueReusableCellWithIdentifier:BuyCarllID];
然后
if (!yourCell)
判断是否重用、没用的话,去缓存池去查找。
yourCell = [[BuyCarDetailCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:youCarllID];
可以在这里设置一些自己的需求总体为:
if (!yourCell){
yourCell = [[BuyCarDetailCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:youCarllID];
// yourCode
}