These lines are both in the implementation file above the @implementation
declaration.
NSString * const aVar = @\"aVarStringValue\";
static NSS
static
keyword in Objective-C (and C/C++) indicates the visibility of the variable. A static variable (not in a method) may only be accessed within that particular .m
file. A static local variable on the other hand, gets allocated only once.
const
on the other hand, indicates that the reference may not be modified and/or reassigned; and is orthogonal on how it can be created (compilers may optimize consts though).
It's worth mentioning that NSString
literals get initialized and never get destroyed in the life of application. They are allocated in a read-only part of the memory.