你的位置:首页 > 软件开发 > 操作系统 > iOS son解析的几种方法

iOS son解析的几种方法

发布时间:2016-03-28 17:01:58
1.NSJSONSerialization具体代码如下 :- (void)viewDidLoad { [super viewDidLoad]; NSData *data1=[NSData dataWithContentsOfFile:[[NSBundle mainBundle ...

1.NSJSONSerialization

具体代码如下 :

- (void)viewDidLoad {  [super viewDidLoad];  NSData *data1=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"test" ofType:@"json"]];    //1.系统提供的json解析方法  NSLog(@"%@",data1);  __autoreleasing NSError *err;   NSDictionary *dic=[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableLeaves error:&err];  NSLog(@"%@",dic[@"user"][@"location"]);  NSLog(@"%@",dic);}

原标题:iOS son解析的几种方法

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。