|
|
@@ -67,22 +67,28 @@
|
|
|
|
|
|
- (void)loadData {
|
|
|
|
|
|
- NSDictionary *json = [RADataProvider loadDataFromBundleFile:@"setting.json"];
|
|
|
- NSMutableArray *tmpArr = [NSMutableArray array];
|
|
|
- NSArray *sectionArr = [json objectForKey:@"sections"];
|
|
|
-
|
|
|
- for (NSDictionary *section in sectionArr) {
|
|
|
+ dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
+
|
|
|
+ NSDictionary *json = [RADataProvider loadDataFromBundleFile:@"setting.json"];
|
|
|
+ NSMutableArray *tmpArr = [NSMutableArray array];
|
|
|
+ NSArray *sectionArr = [json objectForKey:@"sections"];
|
|
|
|
|
|
- RASettingSectionModel *model = [RASettingSectionModel new];
|
|
|
- [model setValuesForKeysWithDictionary:section];
|
|
|
- [tmpArr addObject:model];
|
|
|
- }
|
|
|
-
|
|
|
- NSMutableArray *sections = (NSMutableArray *)self.sections;
|
|
|
- [sections removeAllObjects];
|
|
|
- [sections addObjectsFromArray:tmpArr];
|
|
|
+ for (NSDictionary *section in sectionArr) {
|
|
|
+
|
|
|
+ RASettingSectionModel *model = [RASettingSectionModel new];
|
|
|
+ [model setValuesForKeysWithDictionary:section];
|
|
|
+ [tmpArr addObject:model];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSMutableArray *sections = (NSMutableArray *)self.sections;
|
|
|
+ [sections removeAllObjects];
|
|
|
+ [sections addObjectsFromArray:tmpArr];
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [self.tableView reloadData];
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- [self.tableView reloadData];
|
|
|
}
|
|
|
|
|
|
@end
|