|
IOS, a modified four key variables, namely:
1 @public
This keyword is modified variables are completely open, as long as this kind of object exists, you can access to this variable.
2 @protected
This keyword is modified variables are protected, only in this class it is declared and its subclasses can be accessed.
3 @private
This keyword is modified variables are private and can only be used in the class declaration of this variable, the subclass can not be used.
4 @package
This keyword is more difficult to understand, roughly meaning the variable is modified package can be freely used within this framework, the same effect and @public, but can not be used outside the framework of its subclasses can not use, but the effect is equivalent to @private.
Because @package of this feature, it is very suitable for franework framework.
Expansion point:
Access class variables, we can use the -> symbol, the difference between it and the point is that the grammar, the syntax is actually a set point and get method call, and -> symbols are directly accessible variables. |
|
|
|