Singleton isn't accessible?
I'm somewhat new to objective C (been messing with it for awhile but done nothing professional)
Anyways, I'm working on my first real iphone app right now and I keep my apps settings stored in a singleton which gets read and written to a save file.
I created a few of the screens in a separate application and recently merged them into the main project. My problem is now stemming from the fact that I can not access this singleton from within this new classes I just merged! (Before you ask, YES I am including the necessary files :P)
I'm not sure what code to post since there is so much of it, but here is a snippet of a line that works in the old class files but not the new ones:
NSArray *test = [[[Settings sharedInstance] clockClasses] allKeys];
An interesting fact to note is that all of the classes who can successfully access the singleton do so from the loadView method. The classes that can't are attempting to access it in the viewDidLoad method.
What's even more interesting is if I moved the call in the classes who can't access it from the viewDidLoad method to the loadView method, I can sort of access it. (I get an object return with a count of 0 rather than an EXC_BAD_ACCESS error)
Any help would be great. I've been messing with this for about 4 hours now and I know it should be something really simple.
Thanks!
|