简体   繁体   English

Bad_ACCESS错误,我不太了解

[英]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. 当我尝试运行我的程序时,我收到bad_access错误,通常我可以弄清楚这些东西,但是当我收到错误时,它将跳转到此代码行。

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. 它以前工作过,而storedData是一个NSMutableDictionary。 I dunno if thats enough info, but if anyone could let me know what going on that would be really awesome. 我不知道是否有足够的信息,但是如果有人可以让我知道发生的事情真是太棒了。 Thanks! 谢谢!

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. 打开NSZombieEnabled ,您可能会很快找到位置。

如果要在使用storeData的方法之外创建storeData ,请确保在使用它之前保留了storedData ,并且不会在任何地方释放它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM