James Dunay
James Dunay

Reputation: 2724

Bad_ACCESS error i dont quite understand

i get a bad_access error when i try to run my program, normally i can figure this stuff out but when i get the error it jumps me to this line of code.

int retVal = UIApplicationMain(argc, argv, nil, nil);

I did not write whats above, but when i remove the following program runs fine...

NSLog(@"Store Data Count : %i", [storedData count]);
if ([storedData count] < 4) {

It was working before, and storedData is an NSMutableDictionary. I dunno if thats enough info, but if anyone could let me know what going on that would be really awesome. Thanks!

Upvotes: 0

Views: 81

Answers (2)

xuzhe
xuzhe

Reputation: 5120

If you are creating the storeData outside the method that you are using it, make sure your storedData is retained and not be released anywhere before you use it.

Upvotes: 0

Steven Fisher
Steven Fisher

Reputation: 44876

This means you've messed up your memory management and either over-released an object or sent a message to an object that's been released. Turn on NSZombieEnabled and you'll probably find out where very quickly.

Upvotes: 1

Related Questions