码迷,mamicode.com
首页 > Web开发 > 详细

NSJSONSerialization 转换JSON数据的 NSJSONReadingOptions的意思

时间:2014-08-15 22:26:09      阅读:336      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   数据   ar   cti   div   

[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingOptions error:&error];

NSJSONReadingOptions有三个枚举值,具体含义如下:

1.NSJSONReadingMutableContainers :Specifies that arrays and dictionaries are created as mutable objects. 

指定方法创建的数组和字典是可变的对象。(意思就是 JSONObjectWithData 方法返回的JSON对象中的字典和数组都是mutable的。)

2.NSJSONReadingMutableLeaves :Specifies that leaf strings in the JSON object graph are created as instances of NSMutableString. 

指定方法创建的字符串是可变的对象。(相比较NSJSONReadingMutableContainers, 意思是数组和字典里的成员是可变的字符串。)

3.NSJSONReadingAllowFragments:Specifies that the parser should allow top-level objects that are not an instance of NSArray or NSDictionary. 

指点转换器应该允许顶层的对象不是一个数组或则字典的实例。

NSJSONSerialization 转换JSON数据的 NSJSONReadingOptions的意思,布布扣,bubuko.com

NSJSONSerialization 转换JSON数据的 NSJSONReadingOptions的意思

标签:style   blog   color   io   数据   ar   cti   div   

原文地址:http://www.cnblogs.com/xupeiying/p/3915715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!