For multi thread environment, some times it is difficult to find out the order of command execution, I’m going to share a little trick.

1
2
3
4
if (self.lastLoadBookingFilterSettingsResult == nil) {
DLog(@"[003 Called]");//TEST
[self loadFilterSettings];
}
1
2
3
4
// Only refresh current day's classes
DLog(@"[001 Called]");//TEST
[weakSelf loadClasses:weakSelf.pickerView.selectedItem withPullDownGesture:NO clearOldData:NO];
return;
1
2
3
[weakSelf updateDatePickerView:[weakSelf.settingOptions valueForKey:@"dates"]];
DLog(@"[002 Called]");//TEST
[weakSelf loadClasses:0 withPullDownGesture:NO clearOldData:YES];

Just a single line for debug log info, have fun.