Hi in my application I have a file in URL I want download to my document folder in my application while downloading the file i want to show the progress bar. So I have used the `MBProgressHUD` for that but its not working properly its showing late please tell me how to resolve this one.

My code:

```
- (IBAction)down:(id)sender {
    UIButton *btn = (UIButton *)sender;

     spinner =  [MBProgressHUD showHUDAddedTo:self.view animated:YES];

     spinner.mode = MBProgressHUDModeCustomView;

     [spinner setLabelText:@"downloading....."];

     [spinner setLabelFont:[UIFont systemFontOfSize:15]];

     [spinner show:YES];
   NSURL  *url = [NSURL URLWithString:fileurl];
   NSData *urlData = [NSData dataWithContentsOfURL:url];

    if ( urlData )
     {

        NSArray       *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString  *documentsDirectory = [paths objectAtIndex:0];

        NSString  *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,name];
    [urlData writeToFile:filePath atomically:YES];
     }
   [activityIndicatorObject stopAnimating];
   [spinner hide:YES];

   [spinner removeFromSuperViewOnHide];

   }

```

I have used the above code its taking too much time to show the `MBProgressHUD` Please tell me how to resolve this issue I have stuck here for time.

Thanks..