When I first have data loaded and displayed and then fetch new data from server and then 0 items have to be displayed the app crashes with that output
Assertion failure in -[UICollectionViewData layoutAttributesForDecorationViewOfKind:atIndexPath:], /SourceCache/UIKit_Sim/UIKit-2380.17/UICollectionViewData.m:639
2013-04-04 09:32:43.214 MyApp[84604:c07] *\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for layout attributes for decoration view of kind MSCollectionElementKindDayColumnHeaderBackground in section 0 when there are only 0 sections in the collection view'
This is how I reload the data:
-(void) loadDataFromServer:(BOOL) fromServer{
self.events = [[DataSourceManager sharedInstance] loadAllEventsFromServer:fromServer];
[self.collectionView reloadData];
}
self.events is an Array of Sections. I exchanged NSFetchedResultsController. And it is working if there is no data from the beginning or data with several items.
When I first have data loaded and displayed and then fetch new data from server and then 0 items have to be displayed the app crashes with that output
Assertion failure in -[UICollectionViewData layoutAttributesForDecorationViewOfKind:atIndexPath:], /SourceCache/UIKit_Sim/UIKit-2380.17/UICollectionViewData.m:639 2013-04-04 09:32:43.214 MyApp[84604:c07] *\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for layout attributes for decoration view of kind MSCollectionElementKindDayColumnHeaderBackground in section 0 when there are only 0 sections in the collection view'
This is how I reload the data: -(void) loadDataFromServer:(BOOL) fromServer{ self.events = [[DataSourceManager sharedInstance] loadAllEventsFromServer:fromServer];
}
self.events is an Array of Sections. I exchanged NSFetchedResultsController. And it is working if there is no data from the beginning or data with several items.