0

Following is the scenario for updating my progressview. My problem is that my last progressbar gets updated only .....

  1. The viewcontroller is having button when touched starts download from ftp server. when immediately touched navigates to another view controller where uitableview is showing the different download in progress .

  2. i Put UIProgressView in UITableViewCell dynamically.

  3. I am implementing it in this way....

    -- // cellForRowAtIndexPath // adding progressview to cell

    progressBar = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
    progressBar.hidden=NO;
    progressBar.tag=123+indexPath.row;
    progressBar.frame = CGRectMake(250,170,350,25);
    progressBar.progress=0.0f;
    
  4. Updating progressview's progress in at end of cellForRowAtIndexPath like this ......

       [NSTimer scheduledTimerWithTimeInterval:0.001f target:self selector:@selector(refreshProgress) userInfo:nil repeats:YES];
    
  5. // implementation of refresh progress......

        -(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];
        }
    

    If any one has solution please do write to this thread

Thnx in advnce Paggy 123

user968597
  • 1,164
  • 2
  • 15
  • 30

1 Answers1

0

I don't know how many progresviews you have, but with the method refresProgress, you only call the progress view of the cell of tempArray[1];

You have to subclass a UITableViewCell,and make a method in there with a refreshProgresbar. Then you can loop through the current cells and do a refresh.

tritter
  • 113
  • 1
  • 6
  • i m having dynamic count of progessview and the tempArray is defined in this way------ // in cellForRowAtIndex .........,................. NSString *strIndex=[NSString stringWithFormat:@"%d", progressBar.tag]; tempArray=[[NSMutableArray alloc]init]; [tempArray addObject:strIndex]; [tempArray addObject:cell]; – user968597 May 10 '12 at 10:26