【发布时间】:2012-05-10 10:09:09
【问题描述】:
以下是更新我的进度视图的场景。 我的问题是我的最后一个进度条只会更新.....
触摸时视图控制器有按钮,开始从 ftp 服务器下载。 立即触摸时导航到另一个视图控制器,其中 uitableview 显示正在进行的不同下载。
我将 UIProgressView 动态放入 UITableViewCell 中。
-
我是这样实现的……
-- // cellForRowAtIndexPath // 向单元格添加进度视图
progressBar = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; progressBar.hidden=NO; progressBar.tag=123+indexPath.row; progressBar.frame = CGRectMake(250,170,350,25); progressBar.progress=0.0f; -
更新progressview的进度 在 cellForRowAtIndexPath 的末尾 像这样......
[NSTimer scheduledTimerWithTimeInterval:0.001f target:self selector:@selector(refreshProgress) userInfo:nil repeats:YES]; -
//刷新进度的实现......
-(void)refreshProgress { UITableViewCell *cell=(UITableViewCell *)[tempArray objectAtIndex:1]; NSString * int_index=[tempArray objectAtIndex:0]; FTPManager *objFTPMgr = [[FTPManager alloc] init]; int index1=[int_index intValue]; UIProgressView *prgView=(UIProgressView *)[cell viewWithTag:index1]; prgView.progress = [objFTPMgr putProgress]; [objFTPMgr release]; [prgView reloadInputViews]; }如果有人有解决方案,请写信到这个帖子
Thnx in advnce 帕吉 123
【问题讨论】:
-
请提供有关 tempArray 及其组成的更多信息
标签: uitableview ios-4.2 uiprogressview