首页 > 代码库 > NSJSONSerialization 转换JSON数据的 NSJSONReadingOptions的意思
NSJSONSerialization 转换JSON数据的 NSJSONReadingOptions的意思
[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.
指点转换器应该允许顶层的对象不是一个数组或则字典的实例。
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。