首页 > 解决方案 > 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];
}];
}

标签: objective-cmbprogresshud

解决方案


推荐阅读