0

I want to convert an android app to iPhone. I managed to get the contents of a server by,

 NSString *s =[NSString stringWithFormat:@"www.xyz.com"];
 NSURL *url = [NSURL URLWithString:s];
    //    NSLog(s);
 NSString *content = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:nil];
 NSData *data = [content dataUsingEncoding:NSUTF8StringEncoding];
 NSDictionary *response = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];

But, how to get the progress dialog with rotating spinner till it loads. Kindly help and oblige.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
bharath
  • 953
  • 4
  • 17
  • 30

1 Answers1

5
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeAnnularDeterminate;
hud.labelText = @"Loading";
[self doSomethingInBackgroundWithProgressCallback:^(float progress) {
    hud.progress = progress;
} completionCallback:^{
    [hud hide:YES];
}];
you have add this code 

download source from https://github.com/jdg/MBProgressHUD

Muthu Ram
  • 993
  • 6
  • 15