You need to call [self.tableView reloadData]
after the enumeration block in viewDidLoad
gets completed and self.assetGroup
has been populated. The enumeration block is executed asynchronously, therefore the reloadData is being called before the block is completed and on the table view delegate callbacks your assetGroup contains no data. By the time you start scrolling, the property is populated and you start seeing the images.
I have not seen apple documentation that explains how to detect end of enumeration block, but these two accepted answers indicate that the group value will be nil when the enumeration is over.
iPhone enumerateGroupsWithTypes finishing selector Find out when my asynchronous call is finished
So put an else condition in your group enumeration block -
if(nil!=group){
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
self.assetGroup = group;
NSLog(@"%d images found", self.assetGroup.numberOfAssets);
}
else
[self.tableView reloadData];
Remove the reloadData being called after the enumeration block.
Try taking your enumeration block in CellForRowAtIndexPath out of the GCD queue. That block will execute asynchronously too. No need to dispatch it to a background queue.