解析
NSError *error;
NSString *_ljPath = [[NSBundle mainBundle]pathForResource:@"ljweibo" ofType:@"json"];
NSDictionary *_ljDic = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:_ljPath] options:NSJSONReadingMutableLeaves error:&error];
//数组
NSArray *_ljAllArray = [_ljDic objectForKey:@"data"];
for (NSInteger a = 0; a < _ljAllArray.count; a++)
{
ljWeiboInfo *_info = [[ljWeiboInfo alloc]init];
_info.ljContentStr = [_ljAllArray[a] objectForKey:@"content"];
NSArray *_ljArraylj = [_ljAllArray[a] objectForKey:@"images"];
//获取全部的图片
NSMutableArray *_ljMuArray = [[NSMutableArray alloc]init];
for (NSInteger i = 0; i < _ljArraylj.count; i++) {
[_ljMuArray addObject:[_ljArraylj[i] objectForKey:@"imageurl"]];
}
_info.ljImageUrlArray = _ljMuArray;
[self.ljArray addObject:_info];
}
如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
注:相关教程知识阅读请移步到IOS开发频道。










