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];
}];
}
解决方案
推荐阅读
- docker - 有没有办法自动保存 Docker 容器日志?
- svn - 为什么 svn update 会丢弃本地更改?
- pivot - Vlookup 查找两个项目与数据透视表一起出现的实例数
- java - 使用 cellEditor() 删除带有 jButton 的 jTable 行;
- python - 时间范围检查应该包含还是排除?
- android - 如何在 Android 上的 RxJava 中通过 flatmap 发送自定义的 throwable?
- spring - 使用 Spring Data JPA - 如何在保存父实体和使用 CascadeType=PERSIST 的同时仅保存子实体中的唯一项目
- php - 有时缺少对象索引的填充数据
- reactjs - 我无法使用 react-select 处理更改
- android - 如何使用 Android 的 ImageDecoder 类获取图像大小?