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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:07:22+00:00 2026-05-15T23:07:22+00:00

I am setting my height: – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { CGFloat rowHeight =

  • 0

I am setting my height:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{   
    CGFloat rowHeight = 0;

    if(indexPath.row == [self.items count]){ //more
        rowHeight = 50.0; //same as moreCell 
    }
    else{
        ChartlyCell *cell = (ChartlyCell*)[self tableView:tblView cellForRowAtIndexPath:indexPath];
        rowHeight = cell.totalHeight;
    }

    return rowHeight;   
}

Here is how cell.totalHeight is calculated:

-(float)totalHeight {
    float h = messageLabel.totalheight + 35;
    if(h < 68) h = 68;
    return h;
}

My simulator crashes with no debug errors when NSZombieEnabled = NO. Simulator runs fine when NSZombieEnabled = YES. Not sure how to resolve?

UPDATE:
This is how I am building my initializing my cell:

cell = [[[ChartlyCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier andDelegate:self andChartlyDelegate:self andChartlyObj:myChartlyObject]autorelease];

If I remove the autorelease, everything runs fine. I am still confused why?

  • 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-15T23:07:22+00:00Added an answer on May 15, 2026 at 11:07 pm

    See the Cocoa Memory Management Guide.

    Assuming that cell is an instance variable, consider:

    cell = [[[ChartlyCell alloc] initWithStyle:UITableViewCellStyleDefault
                               reuseIdentifier:CellIdentifier
                                   andDelegate:self
                            andChartlyDelegate:self
                                 andChartlyObj:myChartlyObject]autorelease];
    

    This will cause cell to be reaped when the pool is drained, thus leaving cell pointed to a now-deallocated instance of ChartlyCell. If you want an object to stick around, it must be retained. A retain is implied by alloc and effectively undone by autorelease. Removing the autorelease keeps the object around.

    The simulator should have barfed an error back with zombies enabled. Odd that it didn’t. File a bug via http://bugreport.apple.com/ and attach a built copy of the crashing version of your application with a link to this SO question.

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

Sidebar

Related Questions

I am setting the row height of my UITableView using following code [tableView setRowHeight:
I have been hiding a row in a WPF grid by setting the Height
Question: When I set the rowHeight for UITableView , shouldn't the height of cell
I have problem setting the height of a single row in a ListView. I
I'm setting the height of my UITableViewCell as part of the method heightForRowAtIndexPath:. It's
I have tried setting a line-height for sIFR3 in both the sifr-config.js and my
When setting a content div's height during a jQuery dialog 'dialogresize' event, the div's
I can set the width and height of my canvas by setting the width
I am having a little trouble setting the height of an element that I
Could any one tell me the syntax for setting the height and width for

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.