In my app I hold a int in a Singleton which I set from ClassA. Then in ClassB I grab that int from the Singleton like so:
int myInt = [Singleton sharedSingleton].scoreInt;
Then, since NSDictionary
only supports NSNumber
and not int, I do this:
NSDictionary *theDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:myInt], @"Score", nil];
The problem is that I always get EXC_BAD_ACCESS error. The only thing that shows up in the console is (gdb) in blue. I also have NSZombieEnabled set to ON.
myInt is not nil, confirmed with NSLogs. Is there any reason for this? How can I fix this?
Thanks!