0

我想将一个 android 应用程序转换为 iPhone。我设法通过以下方式获取服务器的内容,

 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];

但是,如何使用旋转微调器获取进度对话框直到它加载。请帮助和义务。

4

1 回答 1

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 

从https://github.com/jdg/MBProgressHUD下载源代码

于 2013-11-11T07:33:57.070 回答