A. Member variable: A variable written in curly braces of a class declaration is called a member variable (also called a property/instance variable)
Member variable cannot leave class leave class is not member variable
member variables can no longer be defined by colleague initialization
The number of members can only be accessed through objects
Member variables are stored in the heap (the current object corresponds to the heap of storage space) will not be automatically released by the system can only be manually released by the programmer
Two. Local variables: Variables written in code blocks or functions are local variables
Scope of a local variable: Start with the defined line, until you encounter curly braces or return (that is, the code block or function at the end of the variable)
A local variable can be initialized before it is defined, or it can be initialized at the same time as the definition.
local variables are stored inside the stack and the system is automatically released .
Three. Global variable: A variable outside the Unload function or outside the curly brace is a global variable
Scope of global variables: from the definition of which line to the end of the file
A global variable can be initialized to a definition, or it can be initialized at the same time as defined.
Global variables are stored in the static zone when the program starts, it allocates storage space until the program ends to release
IOS Local Variables global variable member variable