Why cannot I add attributes to a category ?, Add category attributes?

Source: Internet
Author: User

Why cannot I add attributes to a category ?, Add category attributes?
To declare an attribute using @ property in a category, add the attribute to the attribute list of the class and declare the setter and getter methods, but no corresponding member variables are generated, the setter and getter methods are not implemented either. In addition, an error is reported using the dot syntax. Therefore, attributes cannot be added to a category. However, after @ property is declared in the classification, the setter and getter methods are implemented. In this case, you can assign values and values to this attribute through the dot syntax. That is to say, after using @ property to declare attributes in a category and implementing the setter and getter methods, you can consider that attributes are added to this class. Source: bytes

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.