简体   繁体   中英

iOS - Observer to observe tableView dequeue Reusable Cell

Is it possible to add an observer in iOS development for when a cell is dequeued and reused inside a UITableView ?

Thanks.

You can subclass UITableViewCell and then override the [UITableViewCell prepareForReuse] method. Note that this will only work if your cell subclass has a reuse identifier associated with it so make sure you set a value for that property.

// use to tag your cell with id

cell.Tag = item.ID;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM