Programatically scrolling UICollectionView when estimated item size is set causes crash.
| Originator: | dillan.laughlin | ||
| Number: | rdar://22936683 | Date Originated: | 10-01-2015 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | |
| Classification: | Crash | Reproducible: | Always |
Summary: Programatically scrolling a collection view after setting the estimated item size crash if the user has not already scrolled to the destination position. From the attached backtrace it appears to be a divide by zero issue while calculating layout attributes. Steps to Reproduce: 1. Run the attached sample project. 2. Without manually scrolling, tap the "Scroll to Index Path..." toolbar button to initiate a programatic scroll. Expected Results: Collection view scrolls to specified index path. Actual Results: App crashes with apparent divide by zero layout calculation exception. Version: iOS 9.0.1 Notes: If you comment out the estimated item size code in -[ViewController viewDidLoad], the app will not crash when attempting programatic scrolling. Configuration: iPad Air 2 Attachments: 'collection_view_backtrace.txt' and 'CollectionViewScroll.zip' were successfully uploaded.
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!