Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8480549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:19:27+00:00 2026-06-10T19:19:27+00:00

For example, there are 100 rows in tableView, heightForRowAtIndexPath: was executed already before the

  • 0

For example, there are 100 rows in tableView, heightForRowAtIndexPath: was executed already before the 100th row was show.

Why? In order to calculate contentSize of tableView?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:19:29+00:00Added an answer on June 10, 2026 at 7:19 pm

    From Apple’s documentation :

    Every time a table view is displayed, it calls tableView:heightForRowAtIndexPath: on the delegate for each of its rows

    So yes, it’s called prior to displaying the cell. If you think about it, if the table did it the other way around, it would create a cell with a standard height, put the content in it, get the real height, and resize/shift the cells. That would not be really nice.

    This may cause performance issues, so you should only use it if you have cells of different heights :

    The method allows the delegate to specify rows with varying heights. If this method is implemented, the value it returns overrides the value specified for the rowHeight property of UITableView for the given row.

    There are performance implications to using tableView:heightForRowAtIndexPath: instead of the rowHeight property. Every time a table view is displayed, it calls tableView:heightForRowAtIndexPath: on the delegate for each of its rows, which can result in a significant performance problem with table views having a large number of rows (approximately 1000 or more).

    Otherwise, if all your cells are the same height, use the rowHeight property, and do not implement tableView:heightForRowAtIndexPath:.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say for example there are 5 records shown on screen. I want the
On the Groovy example page there is an example of how to use Groovy
I need to explain this by example: Is there a best practice or preference
How to paginate a word document for example if there are 10 pages: page
Is a C# struct thread-safe? For example if there is a: struct Data {
Is there any example on how to implement a simple login page/dialog? I have
Is there an example of a bitmap color replacement implementation that actually works? I'm
Is there an example of an OAuth implementation or profile which uses multiple authorization
is there any example on using java method to call rhino-javascript function and return
Is there any example on DOS Batch - Find and Replace command for files?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.