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