Skip to content

Instantly share code, notes, and snippets.

@hanfengs
Last active July 19, 2019 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanfengs/417057369b2c7c77fbc0cf3f029752e5 to your computer and use it in GitHub Desktop.
Save hanfengs/417057369b2c7c77fbc0cf3f029752e5 to your computer and use it in GitHub Desktop.
[本地读取json数据]
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