I thought I had read that for a UITableView
that heightForRowAtIndexPath
doesn't get called on all rows, but only on the ones that will be visible. This isn't what I'm seeing however. I'm seeing hundreds of calls to heightForRowAtIndexPath
for the simple situation of the orientation being changed of the iPhone for example.
So I'm assuming here therefore that for a UITableView
with heightForRowAtIndexPath
implemented, it does (i.e. heightForRowAtIndexPath
) get called for all rows (not just the visible ones)...let me know if this isn't quite correct.
QUESTION: Given the above, how many rows in a UITableView
(where heightForRowAtIndexPath
is implemented) can you have before performance issues occur typically?
Is there a way around the performance issues? i.e. set a nominal/standard height for each row and not implement heightForRowAtIndexPath
, but then correctly set each row height only when it is displayed and set it correctly here...but which method would one do this in?
My goodness, I spent over an hour trying to find the source of my performance problem!
Finally I also found hundreds of calls to heightForRowAtIndexPath and a search got me this thread. THAT is really annoying. Performance goes down here already when just displaying 250 items. Thankfully the cells I want to display now all have the same size. But I could imagine someone wanting to display some different cells for a tableView with > 200 items!
FIX THIS APPLE!
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With