iOS Development josnmodel<optional>,<convertondemand>,<index>

Source: Internet
Author: User

  1. Specifies the type of the defined key

    • <optional>Indicates that the field is optional, such as

      //链接字段是可选的,转换的时候允许link未空 @property (nonatomic,strong) NSString</optional><optional> *link;
    • <index>Represents an index, referring to 1

    • <convertondemand>Convert an array of objects, for example:

      //表示数组是LoanModel对象 @property (strong, nonatomic) NSArray<loanmodel , ConvertOnDemand>* loans;
      /*这里保证了JSON里的属性是可选择的  也就是Model中属性多了,少了都无所谓  当用字典给模型赋值时,JSONModel总能找到一一对应得关系  例如: JSON中 有键 hell0_word  username password   而 模型中 只有 username password  那么自动赋值时,就自会把username  password对应的键赋值,而这种情况无法采用KVC。 */+(BOOL)propertyIsOptional:(NSString *)propertyName{    returnYES;}

iOS Development josnmodel<optional>,<convertondemand>,<index>

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.