Objective-C is a super-set of C / C ++, so for static it follows from the C ++ / C convention, you can use it
static <<datatype>> <<variableName>> = initialization
Hoping you would try this way, do you have any mistake, if so, add more clarity to your question.
if in this case with NSString use the following command,
static NSString *pString = @"InitialValue";
and if you need to change NSString in your code, make sure it must be NSMutableString .
Hope that helps ...
Ammitg2k12
source share