[UITableView indexPathsForVisibleRows] methods returns indexPath for non visible rows if screen folds on a section header

Number:rdar://21001593 Date Originated:May 18 2015
Status: Resolved:
Product:iOS Simulator Product Version:iOS 7.1 and iOS 8.3
Classification: Reproducible:Yes
Assuming a UITableView is displayed on screen. If the screen folds on a section header, the indexPathsForVisibleRows returns the index Pathes for the cells contained in this section, even though there are not visible since only the header is partially displayed on screen

Steps to Reproduce:
See test project attached.
This simple project displays a UITableView and make sure the screen folds on a section header.

Expected Results:
[UITableView indexPathsForVisibleRows] returns a number of index paths that corresponds to the number of cells visible on screen

Actual Results:
The number of index paths returned by indexPathsForVisibleRows is greater than the number of cells visible on screen. 
You can see that the number of cells returned by [UITableView visibleCells] in this case is still correct.

Simulator (iOS 7.1 and iOS 8.3)


Simulator using Wifi (XCode 6.3)



Link to the dropbox does not work

I am getting 404, trying to download https://dl.dropboxusercontent.com/u/1007004/VisibleCells.zip

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!