These lines are both in the implementation file above the @implementation
declaration.
NSString * const aVar = @\"aVarStringValue\";
static NSS
The static only changes the scope of the variable, not how it is declared or stored.
In both cases, the compiler will create a constant version of the NSString instance that is stored in the mach-o file. Thus, there is only ever one instance of either (note that you can change the behavior to cause the string to be dynamically created on load of the mach-o, but there is still just one instance).
The static
just marks the aVar
variable as being visible within the scope of the compilation unit -- the file -- only. Without the static
, you could redeclare the string as extern NSString *aVar;
in a header somewhere and have access to it from anywhere.
The const
is orthogonal and, in the case of of NSString reference is pretty much entirely irrelevant.