UICollectionViewFlowLayout: Throws an exception

Originator:evan
Number:rdar://14000272 Date Originated:28-May-2013 11:02 AM
Status:Open Resolved:
Product:iPhone SDK Product Version:6.1.*
Classification:Serious Bug Reproducible:Always
 
This should probably be forwarded to the UIKit team, and is likely a dupe Apple is already aware of...

Summary:

When using UICollectionView's -performBatchUpdates: method to respond to changes initiated by the delegate callbacks from an NSFetchedResultsController, an exception is thrown:

CoreData: error: Serious application error.  An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:.  *** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds for empty array with userInfo (null)

At first it seems like this is a Core Data or NSFetchedResultsController error, however UICollectionViewFlowLayout is the offending class that is calling index out of bounds. Attached you'll see a stack trace that's stopped by an exception breakpoint.

This exception happens when the collection view is using supplemental views (i.e. header or footer views).

I think it is *likely* to be replicated without using NSFetchedResultsController (which would result in an immediate crash since the exception is not caught and handled).

Thanks!

(NOTE: Attached http://i.stack.imgur.com/8lPvP.png )

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!