How to map NSDictionary to a local object in iOS or Mac OS X

Source: Internet
Author: User
Tags define local
During iOS, you may obtain JSON data from the network. Many frameworks can parse JSON strings into NSDictionary. But is it directly used after it is parsed into NSDictionary? Each time you read the value, you must know the type. You must use objectForKey? In this way, we are too troublesome to use. In this case, we usually define local object encapsulation for some business data. It is much easier to read the required values from these business objects. However, converting NSDictionary into a business object is too troublesome, so it is still impossible to manually write code to parse NSDictionary. In fact, you can automatically complete this resolution. In fact, there is already code on the market to complete this part of the function. She is in the RestKit framework. This framework is mainly used to "consume Rest-style Web services" and has some internal functions of ORM. However, the internal modules of this framework are tightly coupled and are difficult to use directly. So this part of the function is extracted: https://github.com/Proteas/RestKit-0.9.3-ORM, easy to use. There is a Demo in github. If you have any questions, please email me. I hope this mechanism or framework will be helpful for your daily development.
Related Article

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.