The array of dictionaries in the array is placed in an array by means of a modal method, and can be implemented using Point Syntax 1. Parse Data: Code:
NSString *path =[[NSBundle mainBundle] pathForResource:@"StudentArr" ofType:@"plist"]; self.stuArr =[NSMutableArray arrayWithContentsOfFile:path];
Using Self.stuarr to receive receipts, this array is full of dictionaries.
2. Then quickly iterate through the dictionary using the Forin method
Code:
for (NSMutableDictionaryinself.stuArr)
3. Assigning a model by KVC
Code:
setValuesForKeysWithDictionary:dic];
By the end of this step, you can implement Stu's point syntax to invoke value in the dictionary.
4. Finally add the data to the array, complete the parsing data
Code:
[self.arr addObject:stu];
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Modal method to parse data in a dictionary