Last active
July 19, 2019 10:49
-
-
Save hanfengs/417057369b2c7c77fbc0cf3f029752e5 to your computer and use it in GitHub Desktop.
[本地读取json数据]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"json" ofType:@"json"]; | |
NSData *data = [NSData dataWithContentsOfFile:jsonPath]; | |
NSError *error = nil; | |
id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error]; | |
NSLog(@"\n%@====%@", [error localizedDescription], result); | |
TSSentencePracticeResultModel *resu = [TSSentencePracticeResultModel yy_modelWithJSON:result]; | |
NSLog(@"====%@", resu); | |
self.dataArr = [self checkDataArr:resu.result.wordPracticeList]; | |
self.index = 0; | |
// if ([self.homework.titleLabel.text isEqualToString:@"作业智能分析"]) { | |
// | |
// YYAnimatedImageView *click_gif = [[YYAnimatedImageView alloc] init]; | |
// click_gif.autoPlayAnimatedImage = YES; | |
// | |
// YYImage *image = [YYImage imageNamed:@"gif_click"]; | |
// click_gif.image = image; | |
// | |
// click_gif.height = 70; | |
// click_gif.width = 164; | |
// click_gif.center = CGPointMake(self.homework.center.x, self.homework.center.y - 50); | |
// [view addSubview:click_gif]; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment