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 7974355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:20:42+00:00 2026-06-04T08:20:42+00:00

I was looking to set up my cell heights dynamically based off of the

  • 0

I was looking to set up my cell heights dynamically based off of the value that you set the custom cell in Interface Builder. This did not work out so I have moved on and found this method in Apples docs that can be used to set the cell height – tableView:heightForRowAtIndexPath:

However I am not sure if I am using it correctly as none of my tableviewcells are adjusting their height they all stay the same standard size. This is the code I am using here.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // Set cell height
    [self tableView:tableView heightForRowAtIndexPath:indexPath];

    // Configure the cell using custom cell
    [[NSBundle mainBundle] loadNibNamed:@"CustomcellA" owner:self options:nil];
    cell = customcellA; // customcellA getters and setters are set up in .h

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 44;
}

any help would be greatly appreciated

  • 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-04T08:20:44+00:00Added an answer on June 4, 2026 at 8:20 am

    lets say the third cell is twice as height:

    - (CGFloat)   tableView:(UITableView *)tableView
    heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.row == 2)
            return 88;
        return 44;
    }
    

    This method will be called by the tableView.

    You shouldn’t do this:

    [self tableView:tableView heightForRowAtIndexPath:indexPath];
    

    It is up to you, how you ensure, that the right cell’s indexPath is identified for other sizes.

    General Rule:
    If you implement the method of a delegate protocol, you will never call it yourself. Only the object of the class, that has a delegate conforming to a protocol, will call the delegate methods.

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

Sidebar

Related Questions

I am looking for a way to set a default value to a cell
I'm looking for a set of classes (preferably in the .net framework) that will
I am looking for a way to dynamically set the window title for a
I am looking to set the background color of a particular cell. The row
Minor quest - looking for a clean way to dynamically set the size of
I'm looking for a way possibly using VBA to apply a cell's fill value
I have a custom table cell, right now, it's all Nib based. When I
I'm looking to set up a blog. There are many what's the best blogging
I am looking to set up a Redmine server on a Windows virtual machine
I am looking for a set of nice plugins to use when developing software.

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.