First, the general local can store lightweight data storage plist This is mainly the operation of the dictionary
Here's how:
NSString * samplefile= [[[NSBundle Mainbundle] Bundlepath] stringbyappendingpathcomponent:@ "sections_ Auth=4.plist"nsdictionary* dic_sections = [nsdictionary Dictionarywithcontentsoffile:samplefile];
Second, sometimes the JSON structure can also be used to parse this does not limit the dictionary, arrays are supported
Here's how:
NSString *samplefile = [[[NSBundle Mainbundle] bundlepath] stringbyappendingpathcomponent:@ "file.json"]; NSString *jsonstring = [NSString stringwithcontentsoffile:samplefile encoding:nsutf8stringencoding Error:nil]; nsdictionary * dic_sections = [jsonstring objectfromjsonstring];//get all the contents of the File.json eg: File.json contents as follows { "Data": [ [ "No" ], [ "Information 001", "Data 002", "information 003" ], [ "Information 001" ], [ "Information 001", "Data 002", "Information 003", "Data 004" ] ], "head": [ "Confidentiality responsibility ", " contract ", " Enterprise Information ", " training materials " ]}