iOS报错Application circumvented Objective-C runtime dealloc initiation for <xxx> object

Application circumvented Objective-C runtime dealloc initiation for <_UIScrollViewScrollIndicator> object.

运行一个比较旧的项目报这个错误,参考这篇文章轻松解决,工程里用到了 IQKeyboardManager,搜索 initialize 修改 IQUIView+Hierarchy.m 中的 initialize 方法:

+(void)initialize 改为 +(void)load

[super initialize]; 改为 [super load];


+(void)load
{
    [super load];
    
    UIAlertSheetTextFieldClass          = NSClassFromString(@"UIAlertSheetTextField");
    UIAlertSheetTextFieldClass_iOS8     = NSClassFromString(@"_UIAlertControllerTextField");
    
    UITableViewCellScrollViewClass      = NSClassFromString(@"UITableViewCellScrollView");
    UITableViewWrapperViewClass         = NSClassFromString(@"UITableViewWrapperView");
    UIQueuingScrollViewClass            = NSClassFromString(@"_UIQueuingScrollView");

    UISearchBarTextFieldClass           = NSClassFromString(@"UISearchBarTextField");
}

你可能感兴趣的:(iOS开发,ios,objective-c)