40 lines
940 B
Mathematica
40 lines
940 B
Mathematica
|
|
//
|
||
|
|
// CYHProvinceCityAreaHelper.m
|
||
|
|
// TreeHole
|
||
|
|
//
|
||
|
|
// Created by iOS on 2023/2/15.
|
||
|
|
// Copyright © 2023 CYH. All rights reserved.
|
||
|
|
//
|
||
|
|
|
||
|
|
#import "CYHProvinceCityAreaHelper.h"
|
||
|
|
|
||
|
|
@implementation CYHProvinceCityAreaHelper
|
||
|
|
|
||
|
|
- (instancetype)init {
|
||
|
|
if (self = [super init]) {
|
||
|
|
[self loadLocalProvinceCityAreaJson];
|
||
|
|
}
|
||
|
|
return self;
|
||
|
|
}
|
||
|
|
- (void)loadLocalProvinceCityAreaJson {
|
||
|
|
NSString *localPath = [NSBundle.mainBundle pathForResource:@"ProvinceCityArea" ofType:@"geojson"];
|
||
|
|
NSData *jsonData = [NSData dataWithContentsOfFile:localPath];
|
||
|
|
id jsonArray = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:nil];
|
||
|
|
_provinceCityAreaModels = [NSArray yy_modelArrayWithClass:CYHProvinceCityAreaModel.class json:jsonArray];
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@end
|
||
|
|
|
||
|
|
|
||
|
|
@implementation CYHProvinceCityAreaModel
|
||
|
|
|
||
|
|
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||
|
|
return @{
|
||
|
|
@"children" : [self class],
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
@end
|