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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:39:54+00:00 2026-05-20T04:39:54+00:00

App crashes after execution of cellForRowAtIndexPath method of tableView It goes into: UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:]

  • 0

App crashes after execution of cellForRowAtIndexPath method of tableView

It goes into:

UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:]

and crashes out.

There is no error shown in Console. It shows EXC_BAD_EXCESS in Status bar of Xcode.

What could be wrong?

EDIT 1:

This is the whole code in my tableView’s cellForRowAtIndexPath method:

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
  {

static NSString *CellIdentifier = @"Cell";
static NSString *newCellIdentifier = @"NewCell";

UITableViewCell *cell = nil;
NSUInteger row = [indexPath row];
NSUInteger count;
if (searching==YES) {
    count = [searchCellTextArray count];
}else {
    count = [cellTextArray count];
} 

if(row==count)
      {

    cell = [tableView dequeueReusableCellWithIdentifier:newCellIdentifier];
    if (cell == nil) 
               {
        cell = [[[UITableViewCell alloc] 
                 initWithStyle:UITableViewCellStyleDefault 
                 reuseIdentifier:newCellIdentifier] autorelease];
    }
    cell.textLabel.text = @"Load more items...";


    cell.textLabel.textColor = [UIColor blueColor];
    cell.textLabel.font = [UIFont boldSystemFontOfSize:14];

}
else 
      {
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) 
              {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }


    UIImage *cellImage = [[UIImage alloc] init];
    NSString *imgName;

    //Searching


    if(searching==YES && [searchCellTextArray count] != 0) 
               {

        NSString *decodedImageName = [NSString stringWithUTF8String:[[[showSearchImageArray objectAtIndex:indexPath.row]valueForKey:@"image"] cStringUsingEncoding:[NSString defaultCStringEncoding]]];
        imgName = decodedImageName;

        cell.textLabel.textColor = [UIColor redColor];
        cell.textLabel.text=[searchCellTextArray objectAtIndex:indexPath.row];

        cell.detailTextLabel.font= [UIFont boldSystemFontOfSize:18];
        cell.detailTextLabel.textColor = [UIColor blackColor];
        cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
        cell.detailTextLabel.numberOfLines= [lableNameArray count]+2;
        cell.detailTextLabel.text = [searchDetailTextArray objectAtIndex:indexPath.row];
    }
    else
              { //searching 

        NSString *decodedImageName = [NSString stringWithUTF8String:[[[showImageArray objectAtIndex:indexPath.row] valueForKey:@"image"] cStringUsingEncoding:[NSString defaultCStringEncoding]]];

        imgName = decodedImageName;


        cell.textLabel.textColor= [UIColor redColor];
        cell.textLabel.text = [cellTextArray objectAtIndex:indexPath.row];



        cell.detailTextLabel.font= [UIFont boldSystemFontOfSize:18];
        cell.detailTextLabel.textColor = [UIColor blackColor];
        cell.detailTextLabel.numberOfLines= [lableNameArray count]+2;
        cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
        cell.detailTextLabel.text = [detailTextArray objectAtIndex:indexPath.row];

    }

    if (imgName !=(NSString*)[NSNull null] && ![imgName isEqualToString:@""] && ![imgName isEqualToString:@"X"]) 
              {
        NSLog(@" Image Name : %@",imgName);

        NSString *documentsDirectory = [self getImagePath];
        NSError *error1;
        NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:&error1];
        if (files == nil) 
                        {
            NSLog(@"Error reading contents of documents directory: %@", [error1 localizedDescription]);
        }


        for (NSString *file in files) 
                        {
            NSLog(@"Loop Entered");
            if([file isEqualToString:[NSString stringWithFormat:@"%@_thumb.png",imgName]])
                  {
                NSLog(@"Image: %@ %@",file,imgName);
                NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:file];

                cellImage = [UIImage imageWithContentsOfFile:fullPath];
                NSLog(@"Full Path: %@",fullPath);

            }

        }

        cell.imageView.image = cellImage;
    }
              else 
              {
        cell.imageView.image = [UIImage imageNamed:@"GlossaryGhostImg1.png"];
    }

}
NSLog(@"Cell For Row At Index Path Done");
return cell;
}

Are there memory leaks here, and have I over-released any objects?

  • 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-20T04:39:54+00:00Added an answer on May 20, 2026 at 4:39 am

    Could be many things: You return a garbage cell. You released your cell too many times. You autoreleased some component of your cell too many times. Sounds like a memory management issue, check your retain/releases carefully. And post your cellForRowAtIndexPath code.

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

Sidebar

Related Questions

I am using getch() and my app crashes instantly. Including when doing: int main()
When I try to allocate a Texture2D the app just crashes. I've stepped through
An app I'm writing always crashes on a clients computer, but I don't get
I have the camera working in my app, but after the picture is captured
Hey guys, my app crashes upon load and it throws up this when debugging:
I've got an app that throws out the GKSession and makes a new one
My app has many controls on its surface, and more are added dynamically at
My app is installed via NSIS. I want the installer to install the program
My app uses a WebRequest at certain points to get pages from itself. This
My app keeps track of the state of about 1000 objects. Those objects are

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.