關於NSJSONReadingOptions參數的含義

enum {

NSJSONReadingMutableContainers = (1UL << 0),

NSJSONReadingMutableLeaves = (1UL << 1),

NSJSONReadingAllowFragments = (1UL << 2)

};typedef NSUInteger NSJSONReadingOptions;


數組中含以上三種參數,

第一種:

NSJSONReadingMutableContainers

Specifies that arrays and dictionaries are created as mutable objects.

是說被創建的數組或者字典應該是可變的


第二種:

NSJSONReadingMutableLeaves

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

是說JSON對象中的被創建的字符串是NSMutableString類型的


第三種:

NSJSONReadingAllowFragments

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

這一句是說解析出的頂層對象可以允許不是NSArray或NSDictionary類型的


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章