Modal method to parse data in a dictionary

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.