所以我的UIWindow基本控制器是一个带有3个UINavigationControllers的UITabBarController,其中2个(3个)包含一个UITableViewController,另一个包含一个UICollectionViewController。如果用户试图在任何其他2个视图(除了包含UICollectionViewController的UINavigationController之外的任何其他视图)上旋转他们的iPhone(我出于某种原因在iPad上没有这个问题),应用程序将崩溃:< / p>
Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UICollectionView.m:3917
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 1. The number of items contained in an existing section after the update (2) must be equal to the number of items contained in that section before the update (2), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).
但是如果用户旋转,那个视图(包含UICollectionViewController的UINavigationController)当前打开或至少打开过一次,它就不会崩溃并且正常运行。这是iOS中的错误吗?有没有办法解决这个问题?