I would like know the limit of maximum number of rows that can be shown in the UItableView. Thanks in advance.
-
Do you have a reason to believe there is a limit? – Eiko Jun 25 '10 at 11:14
-
@Eriko: i am expecting to insert around 3k rows(Text only, with index). So want to know what are the complication that could come up. – thndrkiss Jun 25 '10 at 11:17
-
I've wrapped it up in an answer. – Eiko Jun 25 '10 at 11:31
4 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.

- 6,672
- 3
- 38
- 46
-
1The article also mentions that past 800,000 row of height 44, the single precision float(32 bit platform) used for cell positioning fails (== loses precision and you get partially overlapped cells). – Mihai Timar Feb 27 '14 at 17:03
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.

- 25,601
- 15
- 56
- 71
-
1'NSInternalInconsistencyException', reason: 'Failed to allocate data stores for 9223372036854775807 rows in section 0. Consider using fewer rows' I Was curious and came across this. – Ohmnastrum Jun 06 '16 at 18:24
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 :)

- 5,642
- 1
- 21
- 41
In numberofRawInSection
delegate method we are generally return count of array which is Int type, so maximum number of rows that can be shown on tableview's section = Int.max
So let say capacity "C"
C = (maximum number of section) X (maximum number of item in section)

- 4,768
- 4
- 32
- 51