Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maximum number of rows that can be shown on tableview

I would like know the limit of maximum number of rows that can be shown in the UItableView. Thanks in advance.

like image 757
thndrkiss Avatar asked Jun 25 '10 11:06

thndrkiss


3 Answers

This Cocoa with Love blog post is very informative - it looks at the performance of a table view with thousands of cells.

The question is whether it has some internal hard limit - it's seemingly enough for most needs - the above post concludes:

The iPhone can handle tables with 100,000 rows — and it continues to scroll as smoothly as though it were only 100 rows.

like image 189
petert Avatar answered Oct 04 '22 01:10

petert


There seems to be no maximum. You don't insert actively anyway, you just implement the delegate methods to serve the cells - they are not loaded all at once if done properly.

Just having tried it with one thousand custom cells, it worked without a problem. But with 3k even with index it is a lot to scroll, I'd consider putting them into a navigation hierarchy (but this heavily depends on your use).

One more thing: Make sure to be efficient when drawing the cells, i.e. implement drawRect: instead of cluttering the cells with labels, views etc., this will make scrolling much faster.

like image 33
Eiko Avatar answered Oct 03 '22 23:10

Eiko


You will ultimately be limited by the fact that all the methods such as numberOfRowsInSectiin take integer arguments but hopefully you won't need to approach those limits :)

like image 32
Gary Avatar answered Oct 04 '22 01:10

Gary