I load a few variables in my appdelegate class. They are declared in my .h file.
I have a global.h file that declares the same vars as extern, such as:
appdelegate.h
NSString *DBName;
global.h
extern NSString *DBName;
I haven’t found the pattern yet, but some of the classes I include the global.h but the var is nil.
Any idea what I am doing wrong?
EDIT:
It looks like the vars that are like:
int x;
stick and are available,
but the vars that are pointers get lost:
NSString *Name;
They are all loaded initially from a DB in the appdelegate.
I also tried declaring
char Name[30];
then assigning it and all is good.
Now what?
Problem was the NSStrings were not retained. @xianritchie suggested this in the comment above. I changed the few global strings I have an now all is good.
Thanks all for the help