Question

In my webview I set the download pop actionsheet while it find the anykind of file format.when i click the download button from the actionsheet then it download my file correctly from the url(using NSURLConnection and corresponding methods).Here i need the download progress is visible in another tableviewcontroller with progressbar.

 if ([[[currentURL lastPathComponent]pathExtension]isEqualToString:@"mp3"]||
     [[[currentURL lastPathComponent]pathExtension]isEqualToString:@"pdf"]||
     [[[currentURL lastPathComponent]pathExtension]isEqualToString:@"mp4"]){
     NSLog(@"downloadprogress method");
    NSLog(@"CURRENT URL:::%@",currentURL);

    [passArray addObject:currentURL];
     NSLog(@"PassArray::%@",passArray);
    [[self.tabBarController.tabBar.items objectAtIndex:2] setBadgeValue:[NSString stringWithFormat:@"%d",passArray.count]];




 }

here i add url when i click download button to passArray and pass it to my tableviewcontroller.But that is not working.

Detail Explaination:


  1. I have tabbar with webviewcontroller and tableviewcontroller
  2. in my webview i enter some pdf file url then it pop download
  3. When i click my download button then the url of that pdf will downloding in tableviewcontroller even am in webviewcontroller
  4. if i switch to tableviewcontroller then it display the proggressbar with download progress and corresponding percentage.

Here i done the first 2 steps.How can i do the 3 and 4? Please help me......

Was it helpful?

Solution

+(GlobalVariables *)shareObj{
static GlobalVariables *single=nil;

@synchronized(self){
    if (!single) {
        single=[[GlobalVariables alloc]init];
    }
}
    return single;

}

use singleton to shareobject...........

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top