I have used UICollection view to show items in grid layout.
For data source I have use 5*5 dimensional array.
And also I am returning 5 for numberOfItems in
Just in case others find this question with Google - I received the same error with a very interesting index path:
'NSInternalInconsistencyException', reason: 'UICollectionView received layout attributes for a cell with an index path that does not exist: {length = 2, path = 0 - 0}'
I had simply forgotten to connect the collection view's data source and delegate to the view controller in Interface Builder. D'oh!