MBProgressHUD在完成加载之前逐渐消失

时间:2018-10-02 01:53:36

标签: objective-c mbprogresshud

MBProgressHUD在完全加载到加载大型数据库的应用程序之前消失。

我一直在寻找答案,但是我无法解决该问题。

这是我当前的代码

-(void)beginParsing {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
hud.labelText = LOCALIZED(@"LOADING");
hud.detailsLabelText = LOCALIZED(@"LOADING2");
[self.view addSubview:hud];
[self.view setUserInteractionEnabled:YES];
[hud showAnimated:YES whileExecutingBlock:^{
    _dictJSON = [self performParsing];
} completionBlock:^{
    [hud removeFromSuperview];
    [self.view setUserInteractionEnabled:YES];
    [self setData:_dictJSON];
    [self getCategories];
    [self setFeaturedRestaurants];
    [listView reloadData];
}];
}

0 个答案:

没有答案