Well, you're asking it to... You delay for a very short time before starting the JSON load (which would seem to be pointless) and then dismiss the progress indicator immediately after starting the load.
I think your confusion is that you think the JSON load is done synchronously - but it isn't.
So, remove:
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
Because it isn't helping you. Just start the load after you start the HUD animation. Then, in the success block (on JSONRequestOperationWithRequest
) where you process the JSON, after the scanning code, add the:
[MBProgressHUD hideHUDForView:self.view animated:YES];
If should go right after [self.collectionView reloadData];
.