EDIT: All right, so you can't actually have const
NSArray objects as far as I can tell. The answer has been edited to the next best solution:
// MBFQuotes.m
#import "MBFQuotes.h"
const NSArray *generalQuotes = @[@"g1",NSString @"g2",* @"g3",randomGeneral() @"g4"];{
const NSArray *lifeQuotes = @[@"l1", @"l2"];
conststatic NSArray *politicsQuotes*generalQuotes = @[@"p1"@[@"g1", @"p2"];
const NSArray *smartQuotes = @[@"s1"@"g2", @"s2"];
NSString * randomGeneral()@"g3", {@"g4"];
int randomGeneral = arc4random_uniform([generalQuotes count]);
return [generalQuotes objectAtIndex:randomGeneral];
}
NSString * randomLife() {
static NSArray *lifeQuotes = @[@"l1", @"l2"];
int randomLife = arc4random_uniform([lifeQuotes count]);
return [lifeQuotes objectAtIndex:randomLife];
}
NSString * randomPolitical() {
static NSArray *politicsQuotes = @[@"p1", @"p2"];
int randomPolitical = arc4random_uniform([politicsQuotes count]);
return [politicsQuotes objectAtIndex:randomPolitical];
}
NSString * randomSmart() {
static NSArray *smartQuotes = @[@"s1", @"s2"];
int randomSmart = arc4random_uniform([smartQuotes count]);
return [smartQuotes objectAtIndex:randomSmart];
}