I have an enum defined in the Constants.h file this way:
typedef enum {
CalendarTypeMonth = 0,
CalendarTypeWeek
} CalendarType;
The
In your [Project Name]_Prefix.pch file, you can add this statement:
#import "Constants.h"
In so doing, you'll make your enum available to every file in the project.
EDIT: To access the value, I suggest making it a global property of your application delegate. To take it a step further, you can make your application delegate a method of NSObject using a category so it might look something like:
CalendarType current = [self appDelegate].currentCalendarType
Observe that your property is now a globally gettable/settable property.
You can declare class method to access static variable.
Add such code to your implementation file:
static MyStaticType staticVar = MyStaticTypeDefault;
+(BOOL)myStaticVar
{
return staticVar;
}
+(void)setMyStaticVar:(MyStaticType)newValue
{
staticVar = newValue;
}
And create declarations for this methods in interface file. This is much better then moving all static values to AppDelegate. Anyway, a lot of variants are possible - for example, you can create singletone to store some settings of application or use CoreData.