- How to declare a global int in iPhone app
- AppDelegate.h
- int maxglobal;
- @property (assign) int maxglobal; // define this in app delegate
- int maxglobal; // define this outside any class and it's "global"
- AppDelegate.h:
- @interface AppDelegate{
- int maxglobal;
- }
- @property (nonatomic, readonly) int maxglobal;
- AppDelegate.m
- @implementation AppDelegate
- @synthesize maxglobal;
- extern int maxglobal;