These lines are both in the implementation file above the @implementation
declaration.
NSString * const aVar = @"aVarStringValue";
static NSString *aVar = @"aVarStringValue";
As far as I understand, the second static
is allocated once only within the lifetime of the application and this fact contributes to performance.
But does this mean it is essentially a memory leak seeing as that block of memory will never be released?
And does the first const
declaration get allocated every time it is accessed in contrast?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…