崩溃报错为:找不到Appdelegate里的window
-[项目名.AppDelegate window]: unrecognized selector sent to instance
定位报错位置为:
崩溃位置.png
dispatch_once(&once, ^{ sharedView = [[self alloc] initWithFrame:[[[UIApplication sharedApplication] delegate] window].bounds]; });
解决方法:
第一步:在AppDelegate中键加入window属性
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
第二步:SVProgressHUD.m的638行改为
self.frame = [UIApplication sharedApplication].keyWindow.bounds;
至此问题解决
网友评论