美文网首页
读取json文件

读取json文件

作者: fallrainy | 来源:发表于2015-12-30 12:43 被阅读87次

读取json文件

NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSError *error;
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];

相关文章

网友评论

      本文标题:读取json文件

      本文链接:https://www.haomeiwen.com/subject/ipdihttx.html