Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with UITableView in ios- Overlapping of previous view even is removed from superview
    text
    copied!<p>i have two view controllers and i am using sqlite in my project. in one controller i am creating and showing UITableview and i another i am deleting the table cell via sqlite. my problem is while doing deleting operation from one controller and returning to other, the table view gets overlapped with previous old view. i even removed the tableview and re created it. problem doesnt resolves. any help is appreciated. i attached the screenshot. <img src="https://i.stack.imgur.com/FQqNw.png" alt="enter image description here"></p> <pre><code>// create cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; { NSString *cellIdentifier = @"Cell"; MOProfileTablViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil]; if(cell == nil) { cell = [[MOProfileTablViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; cell.profileLabel.textColor = [UIColor whiteColor]; [cell.profileLabel setFont: [UIFont fontWithName:kfontNameBold size:18]]; cell.profileNumberLabel.textColor = [UIColor whiteColor]; [cell.profileNumberLabel setFont:[UIFont fontWithName:kFontName size:14]]; } if(selectedIndex == [indexPath row] &amp;&amp; [[sqlExecutObj.result objectAtIndex:1] count] &gt; [indexPath row]) { self.preSelectedProfileViewCell = cell; cell.selectionButton.hidden = NO; } else cell.selectionButton.hidden = YES; if ([[sqlExecutObj.result objectAtIndex:1] count] &amp;&amp; [[sqlExecutObj.result objectAtIndex:1] count] &gt; [indexPath row]) {//set cell background color cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[profileColorArray objectAtIndex:indexPath.row]]]; cell.backgroundColor = [UIColor clearColor]; } else { if ([[sqlExecutObj.result objectAtIndex:1] count]== [indexPath row]) { }else { cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"add_newprofile.png"]]; cell.backgroundColor = [UIColor clearColor]; } } if ([[sqlExecutObj.result objectAtIndex:1] count] &amp;&amp; [[sqlExecutObj.result objectAtIndex:1] count] &gt; [indexPath row]) { cell.profileLabel.text = [[sqlExecutObj.result objectAtIndex:0] objectAtIndex:indexPath.row]; cell.profileNumberLabel.text = [[sqlExecutObj.result objectAtIndex:3] objectAtIndex:indexPath.row]; //settings-icon.png if ([[[sqlExecutObj.result objectAtIndex:1] objectAtIndex:indexPath.row] isEqualToString:@"default"]) { [cell.profileImage.layer setBorderWidth:0.0f]; cell.profileImage.image = [UIImage imageNamed:@"group.png"] ; cell.profileImage.frame = CGRectMake(cell.selectionButton.frame.origin.x+cell.selectionButton.frame.size.width+15,13,30 ,30); } else { [cell.profileImage.layer setBorderWidth:2.0f]; cell.profileImage.frame = CGRectMake(cell.selectionButton.frame.origin.x+cell.selectionButton.frame.size.width+15,10,30 , 30); UIImage *imge=[UIImage imageWithData:[NSData dataWithContentsOfFile:[[sqlExecutObj.result objectAtIndex:1]objectAtIndex:indexPath.row]]]; cell.profileImage.image = imge; } if ( [ [ [sqlExecutObj.result objectAtIndex:0] objectAtIndex:indexPath.row] isEqualToString:@"PENDING..."] || [ [ [sqlExecutObj.result objectAtIndex:0] objectAtIndex:indexPath.row] isEqualToString:@"New Virtual Number"] ) { cell.accessoryType =UITableViewCellAccessoryNone; cell.selectionStyle = UITableViewCellSelectionStyleNone; [cell.profileLabel setFont:[UIFont fontWithName:kFontName size:16.5]]; } else { cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; cell.selectionStyle = UITableViewCellSelectionStyleGray; } } else { cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.selectionStyle = UITableViewCellSelectionStyleNone; if ([[sqlExecutObj.result objectAtIndex:1] count] == [indexPath row]) { //customizing cell for manage account cell.profileLabel.text = @"Manage Account"; cell.profileLabel.frame = CGRectMake(cell.profileImage.frame.origin.x+cell.profileImage.frame.size.width+10,12,150,24); cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"settings-bg.png"]]; //settings-icon.png cell.profileNumberLabel.text = nil; [cell.profileImage.layer setBorderWidth:0.0f]; cell.profileImage.image = [UIImage imageNamed:@"settings-icon.png"] ; cell.profileImage.frame = CGRectMake(cell.selectionButton.frame.origin.x+cell.selectionButton.frame.size.width+15,10,30 ,30); [cell.profileLabel setFont:[UIFont fontWithName:kFontName size:18]]; cell.profileLabel.textColor = [UIColor whiteColor]; } else { //customizing cell for add-new-profile cell cell.profileLabel.text = nil; cell.profileNumberLabel.text = nil; cell.profileImage.image = nil; [cell.profileLabel setFont:[UIFont fontWithName:kFontName size:20]]; cell.accessoryType = UITableViewCellAccessoryNone; cell.selectionStyle = UITableViewCellSelectionStyleNone; } } return cell; } </code></pre>
 

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