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

  • Home
  • SEARCH
  • 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 6345979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:55:43+00:00 2026-05-24T20:55:43+00:00

In My TableView I am calculating my cell’s height as per dynamic data, Now

  • 0

In My TableView I am calculating my cell’s height as per dynamic data,

Now here I want to do one thing,

I want to calculate table’s height for only one time ,

after that I want to store it in a array so that when that row come again it should not calculate the whole size.

for this I want to declare a dictionary. In that I want to access two things . Height in integer and status for height is calculated or not.

Now status will note status is true or not. If height is calculated then status is true and height will be stored.

now when I come to there again . it will check if status is true then height should be fetch from dictionary only .

how can I do this?

  • 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-05-24T20:55:44+00:00Added an answer on May 24, 2026 at 8:55 pm

    There is -heightForRowAtIndexPath delegate method for that:

    - (CGFloat)heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        NSDictionary *dict = // get your dictionary for this indexPath
    
        if([[dict valueForKey:@"status"] boolValue] == YES) {
            return [[dict valueForKey:@"height"] floatValue];
        } else {
            return 44.0f;
        }
    }
    

    I wrote this code assumming that your dictionary is like:

    status -> NSNumber: bool [YES/NO]
    height -> NSNumber: float
    

    You can make this dictionary in -viewDidLoad like:

    NSNumber *status = [NSNumber numberWithBool:YES]; // or NO
    NSNumber *height = [NSNumber numberWithFloat:60.0f]; // or 100.0f, for example
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:status,@"status",height,@"height"];
    

    Then you can add this dictionary to some array and read it in -heightForRow...

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

Sidebar

Related Questions

I need to access my cell in the table from tableView:heightForRowAtIndexPath: since I want
In -tableView:heightForRowAtIndexPath: I'm changing the height for a cell dynamically during usage of the
When I scroll my tableview,the whole data in each cell reloads.It doesn't show any
i have tableview with custom cell.the table is divided in many section and rows.i
My tableView app loads the data into the table view. Everything works perfectly, but
I have a tableView and when the user is selecting one of the cells,
The tableview is populated from a .plist. I want to be create an ADD
Inside my TableView, I am pressing one of the cells to enter the detailed
Why tableview data are overlapping? i have attached my code. If i explain my
I am trying to get position of cell in tableview. from this code i

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.