*** Assertion failure in -[MBProgressHUD initWithView:],
2017-09-05 10:48
781 查看
* Assertion failure in -[MBProgressHUD initWithView:],
完美解决方式:创建一个类别,将showHUDAddedTo二次封装为showHUDAddedToView,在程序种调用showHUDAddedToView即可,相对原先调用只是多了一个View单词而已,原理是在View为nil时候,加在window上
+(MBProgressHUD *)showHUDAddedToWindowAnimated:(BOOL)animated{
}
+(MBProgressHUD )showHUDAddedToView:(UIView )view animated:(BOOL)animated{
}
+(void)showToastWithTips:(NSString )tips offset:(CGPoint)offset inView:(UIView )inView{
}
链接:https://share.weiyun.com/4eec5a93fa4985a895404942871a6e21 (密码:y7YICF)
完美解决方式:创建一个类别,将showHUDAddedTo二次封装为showHUDAddedToView,在程序种调用showHUDAddedToView即可,相对原先调用只是多了一个View单词而已,原理是在View为nil时候,加在window上
+(MBProgressHUD *)showHUDAddedToWindowAnimated:(BOOL)animated{
UIWindow * keyWindow = [UIApplication sharedApplication].keyWindow; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:keyWindow animated:animated]; return hud;
}
+(MBProgressHUD )showHUDAddedToView:(UIView )view animated:(BOOL)animated{
MBProgressHUD *hud = nil; if (view != nil) { hud = [MBProgressHUD showHUDAddedTo:view animated:animated]; }else{ hud = [MBProgressHUD showHUDAddedToWindowAnimated:animated]; } return hud;
}
+(void)showToastWithTips:(NSString )tips offset:(CGPoint)offset inView:(UIView )inView{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedToView:inView animated:YES]; // Set the text mode to show only text. hud.mode = MBProgressHUDModeText; hud.label.text = tips; hud.bezelView.backgroundColor = kC_ThemeCOLOR; hud.offset = offset; [hud hideAnimated:YES afterDelay:1.5f];
}
链接:https://share.weiyun.com/4eec5a93fa4985a895404942871a6e21 (密码:y7YICF)
相关文章推荐
- *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/co
- <ObjectC>解决 Assertion failure in -[UITableView _endCellAnimationsWithContext:] 问题
- Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]
- *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory
- Assertion failure in -[UITableView _dequeueReusableViewOfType:withIdentifier:], /BuildRoot/Library/C
- Assertion failure in -[UITableView _endCellAnimationsWithContext:]---错误
- 删除cell时 报错 Assertion failure in -[UITableView _endCellAnimationsWithContext:]
- *** Assertion failure in -[CompensaCommentView _dequeueReusableViewOfType:withIdentifier:],
- *** Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /BuildRoot
- *** Assertion failure in -[UITableView _endCellAnimationsWithContext:]
- Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]
- iOS 运行出现:Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /Sourc
- 解决 Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] crash的方法
- *** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Source
- Assertion failure in -[UITableView _dequeueReusableViewOfType:withIdentifier:], /BuildRoot/Library/C
- iOS 坑点 Assertion failure in - UITableView dequeueReusableCellWithIdentifier:forIndexPath:
- Q6:关于xcode TableView使用Nib文件出现Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:错误
- *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit
- *** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Source
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]