Consider writing a class method or even a C function that lazily creates the array. For example, here's a class method that does what you want:
+ (NSArray *)frequencyChoices
{
static NSArray *choices;
if (choices == nil)
{
choices = [[NSArray alloc] initWithObjects:
@"Daily", @"Weekly", @"Monthly", nil];
}
return choices;
}
Writing the same functionality as a C function makes it even more general:
NSArray *frequencyChoices(void)
{
static NSArray *choices;
if (choices == nil)
{
choices = [[NSArray alloc] initWithObjects:
@"Daily", @"Weekly", @"Monthly", nil];
}
return choices;
}
The advantage of a class method though, is that you could override it in a subclass if that might ever prove handy.