iOS development-member variables, attribute variables essays

Source: Internet
Author: User
  • Member variables are used inside a class, without the need to interact with the outside world, and the member variables include instance variables and normal type variables.
  • Depending on the private nature of the member variable, the attribute variable is available for easy access. The advantage of a property variable is that it allows other objects to access the variable. Of course, you can set up read-only or writable, and the settings can be customized. Therefore, a property variable is a variable that is used to interact with other objects.
  • Some suggestions:

    1. If it is purely a private variable, it is best to declare it in implementation.

    2. If it is the public attribute of the class, it is written in the. h file.

    3. If you need a setter and getter within yourself to implement something, declare it in the category of the. m file.

iOS development-member variables, attribute variables essays

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.