vendredi 30 janvier 2015

iPhone landscape rotation crash UICollectionView

So my UIWindow base controller is a UITabBarController with 3 UINavigationControllers which 2 (of the 3) contain a UITableViewController and one contains a UICollectionViewController. If the user attempts to rotate their iPhone (I don't have this problem on iPad for some reason) on any of the other 2 views (any other view but the UINavigationController one that contains the UICollectionViewController) the app will crash:


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).


But if the user rotates while that view (the UINavigationController one that contains the UICollectionViewController) is currently open or has been opened at least once, it doesn't crash and functions as normal. Is this a bug in iOS? Is there a way I can fix this?




Aucun commentaire:

Enregistrer un commentaire