iOS:mark UICollectionView';显示的单元格

iOS:mark UICollectionView';显示的单元格,ios,objective-c,xcode,uicollectionviewcell,Ios,Objective C,Xcode,Uicollectionviewcell,我正在使用UICollectionViewCell显示事件列表 在屏幕上进行比较时,如何将每个单元格(永久)标记为“已读” 如果我只向下滚动,如果我“播放”滚动(上下移动),停止将标记为“随机”单元格:我认为这是由于重复使用单元格造成的。那么,我该如何解决这个问题呢 详细信息: 每个单元格都是一个定制的笔尖 NSString* cellName = [[MyCell class] description]; UINib* nib = [UINib nibWithNibName:cellName

我正在使用UICollectionViewCell显示事件列表

在屏幕上进行比较时,如何将每个单元格(永久)标记为“已读”

如果我只向下滚动,如果我“播放”滚动(上下移动),停止将标记为“随机”单元格:我认为这是由于重复使用单元格造成的。那么,我该如何解决这个问题呢

详细信息:
每个单元格都是一个定制的笔尖

NSString* cellName = [[MyCell class] description];
UINib* nib = [UINib nibWithNibName:cellName bundle:[NSBundle mainBundle]];
[self.collectionView registerNib:nib forCellWithReuseIdentifier:name];
并在单元格中为ItemAtIndexPath委派:

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    NSString* name = [[MyCell class] description];
    QVEventWallPostCell *cell = [cv dequeueReusableCellWithReuseIdentifier:name forIndexPath:indexPath];

    if(/* control */) {
       [cell markAsRead];
    } else {
        /* */
    }
... 
}

将isRead boolean属性添加到事件对象中,该对象用于显示每个单元格中的数据,而不是单元格本身,并在下次显示单元格时检查其值

Event* thisEvent= [self.dataSource objectAtIndex:indexPath.item];
if(!thisEvent.isRead) {
    thisEvent.isRead=YES;
    // whatever function you use to show the cell as unread; in case the cell is reused from a read cell
} 
else {
     // whatever function you use to show the cell as read
}