In my app I refer to a number of the same string variables from lots of different view controllers and I have created a number of global NSString
s using this method:
OpeningController.h (before @interface)
extern NSString *stringName;
OpeningController.m (after the @interface { } @end)
NSString *stringName =@"On";
I can then refer to/alter stringName anywhere in my application.
I want to be able to do the same with an array of strings but when I try the following I get the error Initializer is not a compile-time constant.
How do I achieve what I am trying to achieve?
OpeningController.h
extern NSArray *arrayName;
OpeningController.m (after the @interface { } @end)
NSArray *arrayName = [NSArray arrayWithObjects:
@"String1",
@"String2",
@"String3",
@"String4",
nil];