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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:22:00+00:00 2026-05-23T16:22:00+00:00

I have a table view with custom cell that contains UITextView, UILabel and a

  • 0

I have a table view with custom cell that contains UITextView, UILabel and a UIButton.

The problem is,

When the table is loaded first time, 2 cells are shown and are fine. but any of the cell get scrolled out of the screen while scrolling the table, app suddenly get terminated without showing any exception error to Console.

this is my code,

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

NSLog(@"In tableView:Cell");    
static NSString *CustomCellIdentifier = @"CustomCellIdentifier ";

CourtsFavoriteCustomCell* cell = (CourtsFavoriteCustomCell *)[tableView dequeueReusableCellWithIdentifier: CustomCellIdentifier];

if( cell == nil)
    {
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CourtsFavoriteCustomCell"
                                                    owner:self options:nil];

    for (id oneObject in nib) 
        if ([oneObject isKindOfClass:[CourtsFavoriteCustomCell class]])
        cell = (CourtsFavoriteCustomCell *)oneObject;

//*********** Creating button inside each TableView cell..

        UIButton *mapButton = [UIButton buttonWithType:UIButtonTypeRoundedRect] ;

        [mapButton setFrame:CGRectMake(120.0f, 157.0f, 72.0f, 32.0f)] ;
        //btnDetail.backgroundColor = [UIColor grayColor];
        [mapButton setTitle:@"Map" forState:UIControlStateNormal];
        [mapButton setTitleColor: [UIColor redColor] forState: UIControlStateNormal];
        //[mapButton.titleLabel setFont:[UIFont fontWithName:@"Verdana-Bold" size:12]];
        [mapButton setBackgroundColor:[UIColor clearColor]];
        [mapButton sizeThatFits:mapButton.frame.size];
        [cell addSubview:mapButton];
        [mapButton addTarget:self 
                      action:@selector(cellMapButtontapped:)
            forControlEvents:UIControlEventTouchUpInside];
        forState:UIControlStateNormal];

    }
NSLog(@"App get terminated after showing this log message to console when scrolling tableview");



    cell.name.text         = favCourtName;  // name is a UIText view and if comment this line of code, every thing works fine
    cell.address.text      = favCourtAddress;   


    cell.accessoryType          = UITableViewCellAccessoryDetailDisclosureButton; 

     return cell;


}

I am using UITextView (Cell.name in the code)in my custom cell. When I tried commenting the UITextView code out, then everything works fine.

Please help me 🙂 thanx..

  • 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-23T16:22:00+00:00Added an answer on May 23, 2026 at 4:22 pm

    @All, Thanx for all of yours answers.. 🙂
    I solved the problem. It was not with UITextView.

    And why I am writing here because, If anybody else comes here with the same problem it may help.

    Problem was actually very simple, but took my 2 days to find out because it did not show any exceptions.

    What I did was, just added the ‘retain’ to my ‘favCourtName’ in my ViewDidLoad method. Its like this,

    NSString * favCourtName = [[[NSString alloc] initWithFormat:@"myCourt"] retain];
    

    The word ‘retain’ does the magic. Thank you

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

Sidebar

Related Questions

I have a table view that has custom cells. In every cell I have
I have a table view with three sections. The first section contains custom cells
I have a custom cell that contains a button in a table view. The
I have a custom view in a custom table cell. Every time a specific
I have a table view with custom cells and I recognize swipes in that
I have a custom Table View Cell that displays the details of a Conference
I have a table view controller with custom cells. In those cells i added
I have a custom cell and i displayed that custom cell in a table
I have several parts in my app where I use custom table view cells.
I'm having a problem. I have a Custom UITableViewCel, the cell contains a slider

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.