I have a sample app with single view controller. The controller's view has subviews look like following
UIView
UIScrollView -- (Frame = {0, 0, 320, 480})
UICollectionView -- (firstCollectionView, Tag = 0, Frame = {0, 0, 320, 480})
UICollectionView -- (secondCollectionView, Tag = 1, Frame = {480, 0, 320, 480})
UICollectionView -- (thirdCollectionView, Tag = 2, Frame = {960, 0, 320, 480})
Then, in viewDidload I call
[self.firstCollectionView reloadData]; // Tag = 0
[self.secondCollectionView reloadData]; // Tag = 1
[self.thirdCollectionView reloadData]; // Tag = 2
And in the delegate method, numberOfSectionsInCollectionView:, I put NSLog to see which collectionView start reloading its data first
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
NSLog(@"Tag : %i", collectionView.tag);
}
Surprisingly, I got this result
2014-05-27 12:20:22.462 SampleApp[60652:60b] Tag : 2
2014-05-27 12:20:22.462 SampleApp[60652:60b] Tag : 1
2014-05-27 12:20:22.462 SampleApp[60652:60b] Tag : 0
Everytime I tried, it will result like this (2 -> 1 ->0) Do you have any idea why is the result (log) is reverse? Is it something to do with threading?
Best
P.S. I can't share the actual code, but, this is everything that related to the UICollectionView issue. I just call reloadData of multiple UICollectionView that is contained in a single UIScrollView in controller's viewDidLoad, and found this weird result.