Static string variable in Objective C on iphone
- by Prajakta
Hi,
How to create & access static string in iPhone (objective c)?
I declare static NSString *str = @"OldValue" in class A.
If i assign some value to this in class B as str = @"NewValue".
This value persists for all methods in class B. But if I access it in class C (after assignment in B) I am getting it as OldValue.
Am I missing something? Should i use extern in other classes?
Thanks & Regards,
Yogini