- 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