I have problems with [UICollectionView reloadData] , which seems to be stuck for quite some time before it calls numberOfSectionsInCollectionView in its dellet, which I specified. Here's what happens:
The application starts with the fact that UICollectionView is immediately visible, and the delegate is called numberOfSectionsInCollectionView , which returns the number of elements in an empty array (i.e. 0) and immediately starts loading data for the array from the web service. After loading is complete, the data is deserialized and added to the above array, then reloadData is called on the UICollectionView instance. This application stops doing anything, and after 20-30 seconds (or sometimes up to a minute), the delegate receives a call to numberOfSectionsInCollectionView . Once this call is received, the reboot completes quickly.
I believe that reloadData works in its own thread, but I tried to run it in a separate thread to make sure that this is not my code blocking the process. What can reloadData do while it seems stuck? Are there any proxy delegate methods between reloadData and numberOfSectionsInCollectionView that I have to execute? I thought this was the first method that is called after a reboot against the iOS developer.
If anyone could tell me what might be wrong, fantastic, but I also appreciate any advice on how to debug this!
source share