我在 didSelectItem 上为我的 TableView 加载核心数据,但这使得标签栏感觉迟缓,直到新数据加载后才会更新。解决此问题的好方法是什么?我可以在数据加载之前更新选项卡栏和空白表格视图,还是可以以某种方式显示活动指示器?
这是我当前的代码
- (void) tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
NSInteger index = [item tag];
NSMutableArray *schedule = [dataHandler fetchEntriesForCourse:[[_Courses objectAtIndex:index] valueForKey:@"CourseCode"]];
tableView.schedule = schedule;
}