Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView reloadData method creates a trouble of blurry data
    text
    copied!<p>I have a <code>UITableView</code> in which each <code>UITableViewCell</code> having a <code>UIView</code> on them and and above <code>UIView</code> i have two <code>UIButton</code> and two <code>UILabel</code>. My problem is this when i am reloading the tableview then the new data is rewritten on the old data that makeks content blurred and unclear and in method <code>cellForRowAtIndexPath</code> i used this code of removing label then it is also not working properly.......</p> <pre><code>NSArray *subviews = [[NSArray alloc] initWithArray:cell.contentView.subviews]; for (UILabel *subview in subviews) { [subview removeFromSuperview]; } [subviews release]; </code></pre> <p>This code is showing a row at a time otherwise no one...</p> <p>The code of <code>cellForRowAtIndexPath</code> is this....</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView1 cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"Cell"; UITableViewCell *cell = [tableView1 dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; NSDictionary *dict = [appDelegate.webDataList objectAtIndex:indexPath.row]; tableView.backgroundColor = [UIColor colorWithRed:0.39 green:0.39 blue:0.39 alpha:0.39]; if([appDelegate.dataArray count]&gt;0){ imgView.backgroundColor = [UIColor clearColor]; imgView =[[UIView alloc ] initWithFrame:CGRectMake(0,0,320,45)]; imgView.tag= indexPath.row+250; [cell.contentView addSubview:imgView]; button=[UIButton buttonWithType:UIButtonTypeCustom]; button.frame=CGRectMake(291, 5, 19, 21); img =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"swap_re" ofType:@"png"]]; [button setBackgroundImage:img forState:UIControlStateNormal]; [button addTarget:self action:@selector(swapButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; button.tag= indexPath.row+250; [imgView addSubview:button]; button=[UIButton buttonWithType:UIButtonTypeCustom]; button.frame=CGRectMake(-25, 5, 19, 21); img =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"swap_re" ofType:@"png"]]; [button setBackgroundImage:img forState:UIControlStateNormal]; [button addTarget:self action:@selector(swapButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; button.tag= indexPath.row+250; [imgView addSubview:button]; button=[UIButton buttonWithType:UIButtonTypeCustom]; button.frame=CGRectMake(5, 7, 19, 21); button.tag = indexPath.row+250; img =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"delete" ofType:@"png"]]; [button setBackgroundImage:img forState:UIControlStateNormal]; [button addTarget:self action:@selector(deleteButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [imgView addSubview:button]; NSArray *arr = [[appDelegate.dataArray objectAtIndex:indexPath.row] componentsSeparatedByString:@"/"]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(34,9,140,20)]; label.text = [arr objectAtIndex:1]; label.tag = indexPath.row+250; [label setFont:[UIFont fontWithName:@"Georgia" size:14]]; [label setNumberOfLines:0]; label.textAlignment = UITextAlignmentLeft; label.textColor = [UIColor whiteColor]; label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; label.backgroundColor = [UIColor clearColor]; [imgView addSubview:label]; [label release]; NSDictionary *dict1 =[appDelegate.webDataList objectAtIndex:indexPath.row]; label = [[UILabel alloc] initWithFrame:CGRectMake(181, 7, 75, 20)]; label.tag = indexPath.row+250; label.text = [dict1 objectForKey:@"time"]; [label setFont:[UIFont fontWithName:@"Georgia" size:16.0]]; label.textAlignment = UITextAlignmentLeft; [label setBackgroundColor:[UIColor clearColor]]; label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; [label setTextColor:[UIColor whiteColor]]; [imgView addSubview:label]; [label release]; } return cell; } </code></pre> <p>and in my code i am not able to use the method <code>reuseTableViewCellWithIdentifier:</code> because i want each label and button tag should be same because i have to fetch them else where.</p>
 

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