UICollectionViewCells Not Being Reused
| Originator: | JamesValaitis | ||
| Number: | rdar://14973972 | Date Originated: | 12/09/13 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | iOS 7 GM |
| Classification: | Important | Reproducible: | Sometimes |
Summary: When scrolling through a UICollectionView each cell is being initialised each time and no cell is being resued. I have been able to confirm this by overriding the prepareForReuse method and checking if it is called, but it's not. initWithReuseIdentifier: style: is always called though. Steps to Reproduce: Create UICollectionView and a custom UICollectionViewCell programatically. Obviously register the class with the collection view and with an appropriate reuseIdentifier. In cellForRow retrieve a cell using the identifier and indexPath. Override the prepareForReuse method to check if the cells are reused. If the same problem has arisen for you, then they will be being initialised each time. Expected Results: The UICollectionViewCell subclasses should be being reused. Actual Results: The UICollectionViewCell subclass is being initialised each time. Version: Xcode 5 and iOS 7 GM. It has been a problem since Beta 5 and DP5. Notes: Massive problem, please sort this out because I was surprised to see it still broken in the GM. Configuration: Occurs on both my iPod Touch 5th Gen as well as each iPhone simulator.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!