In my app i have about 30 strings i would like to store somewhere. I want to use it in couple classes later, and it will be used only once in every class. Where is the best place to store it? I read about singleton class in ios, but i’m not sure if this is solution for me.
I want to make something like NSArray where in for loop i can search the array.
I’ve tried to define it like:
NSArray *arr = [NSArray arrayWithObjects:@"something",@"else", nil];
But i can do it in .h file, and i’m not sure if for constant variables i want to have a class.
Well, if you don’t mind, you can have a plist file with an
NSArrayand all yourNSStringsinside of it, then to load them:The Singleton pattern is a solution, but for what the op wants, a plist is more than enough.