Setter method under Arc
-(void) Setuserarray: (Nsarray *) Userarray
{
_userarray = Userarray;
}
Getter method
-(Nsarray *) Userarray
{
return _userarray;
}
Setter under the MRC
-(void) Setuserarray: (Nsarray *) Userarray
{
if (_userarray! = Userarray) {
[_userarray release];
_userarray = [Userarray retain];
}
}
Getter method
-(Nsarray *) Userarray
{
return _userarray;
}
Getter Method MRC ARC is the same
If the getter and setter are all rewritten, you need to add
when you need to override the setter and getter methods, you need to with @sythesize abc = _ABC;
When overriding one, you do not need to use
you can see that in the interface @interface parentheses are collectively referred to as "member variables", the instance variable is one of the member variables!
the English translation of the instance variable is Instance Variable (object-specific storage)
An example of the English translation of Instance(manifestation of a class ) is said to be "the performance of the classes", stating that the instance variables should be Variables defined by the class!
remove basic data type int float .... And so on, other types of variables are called instance variables. That is, instance variables (with setter and getter) + Basic data type variables (int, float, and so on) = member variable
* * Instance variable + basic data type variable = member Variable * *
Getter and Setter methods