Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.08k stars 1.38k forks source link

引用QMUI后,在UIViewController的viewDidLoad方法里直接调用返回会闪退 #1226

Closed wangxuewen closed 3 years ago

wangxuewen commented 3 years ago

Bug 表现 在UIViewController的viewDidLoad方法里直接调用 popToViewController(返回)会闪退

截图 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'QMUI 认为 popViewController 会成功,但实际上失败了' terminating with uncaught exception of type NSException CoreSimulator 732.18.6 - Device: iPhone SE (2nd generation) (A734E31E-4364-41EB-A4B0-D32FA4B82780) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone SE (2nd generation)

如何重现

  1. 新建一个页面,在viewDidLoad里直接调用 [self.navigationController popViewControllerAnimated:YES];

  2. ...

预期的表现 正常情况下,应该是直接返回

其他信息

NiHang commented 3 years ago

最后是怎么解决的?

wangxuewen commented 3 years ago

最后是怎么解决的? 没有解决,这个是debug环境下会出现, A页面pushB页面,在B页面的viewdidload方法中直接pop返回会出现这个情况。想处理的话可以在崩溃页面debug环境下返回加个延迟处理。

MoLice commented 3 years ago

请参考这个临时改法,再等新版本发布。 https://github.com/Tencent/QMUI_iOS/issues/1180#issuecomment-860120552

MoLice commented 3 years ago

已发布 4.3.0 解决该问题。