7

I put a UIProgressView on a UITableViewCell, like that:

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"downloadcell"];
if(cell==nil)
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
                                 reuseIdentifier:@"downloadcell"] autorelease];
    UIProgressView* downPreView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
    downPreView.tag = 123;
    downPreView.frame = CGRectMake(400,70, 200,10);
    [cell.contentView addSubview:downPreView];
}

When download size have changed, I do that:

    UIProgressView* downPreView = (UIProgressView*)[cell viewWithTag:123];
downPreView.progress = downloadPre;

but the look of downPreView will not change immediately, only after I touch cell or other cell, so how to make UIProgressView on the UITableViewCell change immediately?

brainjam
  • 18,863
  • 8
  • 57
  • 82
Tinyfool
  • 1,460
  • 2
  • 18
  • 40

1 Answers1

4

performSelectorOnMainThread on it and everything is fine.

Tinyfool
  • 1,460
  • 2
  • 18
  • 40