iOS-UISearchController 的 Bug 之 Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()

如下报错:

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()

iOS-UISearchController 的 Bug 之 Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UISearchController: 0x7fb91a72b400>)_第1张图片
点击退出登录时,控制台打印的错误提示.png
解决办法:
-(void)dealloc
{
    /**
     * 解决退出登录时 UISearchController 报错的相关问题
     */
    [self.searchVc.view removeFromSuperview];
}

你可能感兴趣的:(iOS-UISearchController 的 Bug 之 Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ())