0

I have a UIProgressView object in reflection view of iCarousel class

When i m trying to update the ProgressView its not updating

For updating of progress view i m using delegate method

When the download completes for an image i m calling the delegate method like this

if([viewdelegate respondsToSelector:@selector(DidFinishprocess:tag:)])
{
     [viewdelegate DidFinishprocess:value tag:bookid];
}

and on another side to update the progress bar i m implementing this method

-(void)DidFinishprocess:(float)progress tag:(int)bookid
{
NSArray *arr = carousel.visibleItemViews; //carousel.visibleItemViews;
    for (UIView *vi in arr)
    {
        if ([vi isKindOfClass:[ReflectionView class]])
        {
             if (vi.tag == bookid)
             {

                 for (UIProgressView *v in vi.subviews)
                 {
                      if ([v isKindOfClass:[UIProgressView class]])
                      {
                            progressView = (UIProgressView*)v;
                            [progressView setProgress:progress animated:YES];
                            NSLog(@"%f",progress);

                            //Here i m getting the new value of progress bar but the progress view doesn't how the update                                                                       

                            progressView=nil;
                            break;
                      }
                  }
               }

            }
        }
 } 
deve1
  • 195
  • 1
  • 3
  • 14

1 Answers1

0
- (void)DidFinishprocess:(float)progress tag:(int)bookid
{ 
    //code  ...

    [progressView setProgress:progress animated:YES];

    //code  ...
}

The value of assigned progress variable must be float.

UIProgressBar values range from 0.0 (0%) to 1.0 (100%)

Your value should be incremented in a fraction such as 0.1, 0.2, 0.3, etc. For example:

[progressView setProgress:bytesReceived/bytesTotal animated:YES];

If you are getting values of progress ranging from 0 to 100 (such as 10, 11, 12...) then you'll have to make it a fraction, dividing it by 100:

[progressView setProgress:progress/100 animated:YES];
Velociround
  • 611
  • 7
  • 18
utkal patel
  • 1,321
  • 1
  • 15
  • 24