wordpress-mobile / MediaPicker-iOS

WPMediaPicker is an iOS controller that allows capture and picking of media assets.
GNU General Public License v2.0
110 stars 37 forks source link

App crashed after photo taken #73

Closed lealife closed 8 years ago

lealife commented 9 years ago

I debug it at: https://github.com/wordpress-mobile/MediaPicker-iOS/blob/7a7e99a2c817cb33cf506a142f6387e510e54b66/Pod/Classes/WPMediaCollectionViewController.m#L643

[self.collectionView insertItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:insertPosition inSection:0]]];

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (336) must be equal to the number of items contained in that section before the update (336), 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).'

lealife commented 9 years ago

It's weird that sometimes it's good, and sometimes it crash the app.