In Layman's words:
when the extern field is used, the declared variable is a global variable and can be called, as well as a narrower term: extern can extend a variable in one class to another class;
Static variables declare variables, variable values after the change, save this change, each time you use to read the value;
Const declares that the value of a variable is immutable, is a property of ReadOnly, and cannot be changed.
Specific usage:
1.static usage: static nsstring *str = @ "haha";
2.const usage: nsstring *const str = @ "haha";
3.extern usage: In A.h, declare a variable extern nsstring *str = @ "123"; This declares a global variable, in the B.h inside the same write code extern nsstring *str, and then b.m inside directly print str can print out 123来, when used without the need to import A.h file header, or whether the classification has been created and so on.
Hope to have some help, later when writing code can be more tall on some, is also a skill.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Little fat says things------iOS extern,static and const differences and usage