Cocoa touch 如何使UITableViewCell上的UIProgressView立即更改?
我将UIProgressView放在UITableViewCell上,如下所示:Cocoa touch 如何使UITableViewCell上的UIProgressView立即更改?,cocoa-touch,uikit,ios,uitableview,uiprogressview,Cocoa Touch,Uikit,Ios,Uitableview,Uiprogressview,我将UIProgressView放在UITableViewCell上,如下所示: UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"downloadcell"]; if(cell==nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
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];
}
当下载大小发生变化时,我会这样做:
UIProgressView* downPreView = (UIProgressView*)[cell viewWithTag:123];
downPreView.progress = downloadPre;
但downPreView的外观不会立即改变,只有在我触摸单元格或其他单元格之后,所以如何使UITableViewCell上的UIProgressView立即改变?在其上执行SelectorOnMainThread,一切都很好