Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem while scrolling the UITableView with custom cell that contains a UItextview
    primarykey
    data
    text
    <p>I have a table view with custom cell that contains UITextView, UILabel and a UIButton.</p> <p>The problem is, </p> <p>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. </p> <p>this is my code, </p> <pre><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; } </code></pre> <p><strong>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.</strong> </p> <p>Please help me :) thanx..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload