提取本地json

来源:互联网 发布:mac系统安装 编辑:程序博客网 时间:2024/06/05 03:00

提取本地json

by 伍雪颖


NSData* data=[NSDatadataWithContentsOfFile:[[NSBundlemainBundle]
                                                
pathForResource:@"localobj"
                                                ofType:@"json"]];
NSError* error;
NSDictionary *localObj =[NSJSONSerializationJSONObjectWithData:data
                                                       options:NSJSONReadingMutableContainers
                                                         error:&error];

1 1
原创粉丝点击