1

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......

Arunkumar
  • 45
  • 8
  • 2
    Keep a reference to the download percentage and which row it's supposed to update. Then just update that progress bar with that percentage ? You will likely need a third part class (singleton perhaps) that holds a reference to the download. – CW0007007 May 06 '14 at 11:47
  • when u click on tableview controller button then call one method [self sendSubViewToBack:yourVC.view] then it will go back and when u want to see ur table view then call [self bringSubViewToFront:yourVC.view]; – amit soni May 06 '14 at 11:48
  • could you please give me some link which explain details? – Arunkumar May 06 '14 at 11:49
  • Duplicate of http://stackoverflow.com/questions/16453655/objective-c-downloading-file-with-progress-bar – Adithya May 06 '14 at 11:53
  • 1
    Ya I did this but this will download file on same viewcontroller.But I need to add my each download url to anotherviewcontroller i.e(tableviewcontroller) with download progressbar – Arunkumar May 06 '14 at 11:58

1 Answers1

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

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

}

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

arun
  • 106
  • 2
  • 11