[[MPPlayableContentManager sharedContentManager]reloadData];
Running above code will not call the below code for the current indexPath if it was called very recently
- (NSInteger)numberOfChildItemsAtIndexPath:(NSIndexPath *)indexPath;
Calling reload data with at least 0.4 seconds of delay will trigger numberOfChildItemsAtIndexPath correctly.
Calling reloadData with delay is not a good solution.
I do not use beginLoadingChildItemsAtIndexPath as it is not usable in my case.
Scenario:
- Show "countries" as a container.
- Touch "countries". (it is already loaded)
- It will show countries.
- It will call beginLoadingChildItemsAtIndexPath for the countries on the screen but I will ignore it because I cannot load detailed information for all of the visible countries as that means lots of data from database. In this case, I can only load them when a call to numberOfChildItemsAtIndexPath is made for the country container I touched. So there is no other way for me than calling my data-loading-methods inside numberOfChildItemsAtIndexPath. While it is loading, I return 0 instantly as the number of child items and as soon as my data-loading-methods load details for the selected country container, it calls reloadData so MPPlayableContentManager can reconstruct everything. This works, but as it does not check number of child items for the current indexPath, it does not refresh current screen. The only solution I found is to call reloadData with 1 second delay, which does not sound good. How can I force the framework to call numberOfChildItesAtIndexPath for the current indexPath too?