I use the variable / property of my application delegate as global. (I do not want to deal with a singleton class.)
I am trying to write a #define statement in the Application Delegate class. If I print:
[UIApplication sharedApplication]
in my application delegate class, the code hint does not recognize sharedApplication. But if I find the same thing in the viewController class, "sharedApplication" appears correctly.
To define an NSMutableDictionary in my Application Delegate.h (or .m?), I write:
#define MyDictionary [[[UIApplication sharedApplication] delegate] stateDictionary]
Then, if I try to use it in another class:
[[MyDictionary objectForKey:@"California"] largestCity];
I get a message that MyDictionary should be declared first. I am really confused by many ideas here.
Bryan