美文网首页
读取本地json文件

读取本地json文件

作者: 林希品 | 来源:发表于2022-02-08 11:28 被阅读0次
    NSString *path = [[NSBundle mainBundle] pathForResource:@"jsoncode" ofType:@"json"];
    NSData *data = [[NSData alloc] initWithContentsOfFile:path];
    NSArray *array =  [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
    /
    NSDictionary *dic =  [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
    ...

相关文章

网友评论

      本文标题:读取本地json文件

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