IOS中的JSON数据的解析

解析Json数据

1 //加载.json文件
2 NSString *path = [[NSBundle mainBundle]pathForResource:@"product.json" ofType:nil];
3 //根据路径加载json文件到nsdata中
4 NSData *data = [NSData dataWithContentsOfFile:(path)];
5 //将加载进来的nsdata数据转换为OC中对应的对象
6 [NSJSONSerialization JSONObjectWithData:(NSData *) options:(NSJSONReadingOptions) error:(NSError *__autoreleasing *)];

UIWebView

1 [webView loadRequest:NSURLRequest *]

 

posted @ 2015-06-02 13:38  王世桢  阅读(324)  评论(0编辑  收藏  举报