Private member variables and private properties can be declared in. m files
Property has done three things: Create an instance variable that starts with an underscore, generate a getter, and setter method.
Member variables: create only instance variables;
The property automatically generates the Setter,getter method, sometimes generating some useless methods, causing the program's IPA volume to be too large.
Use member variables to run faster.
Use property when development uses lazy loading (variables are loaded when needed)
-(Nsmutablearray *) Imagesarr
{
if (_imagesarr = = nil) {
_imagesarr = [Nsmutablearray array];
}
return _imagesarr;
}
Recommendation: When you do not need to use lazy loading, directly in the. m file to create instance variables using _XX, to reduce the volume of IPA, improve the speed of the program, to minimize the mix of the situation.
iOS Development private variable use selection for private properties