我想创建一个单元格对象的副本.以下是我的代码,但检索copyWithZone:]:发送到实例的无法识别的选择器 CollectionCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"KCell" forIndexPath:indexPath]; if(k
CollectionCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"KCell" forIndexPath:indexPath];
if(kCell == nil)
{
cell = [self getiPadCell:indexPath cv:cv dict:dict];
kCell = cell;
return cell;
}
else
{
cell = [kCell copy];
return cell;
}
您的CollectionCell类应提供copyWithZone:方法的实现.它也应该符合NSCopying协议.想想你如何复制你的单元格并提供适当的实现.
This Link可以帮助您更好地理解它
