当前位置: 代码迷 >> Access >> 查看EXC_BAD_ACCESS或SIGABRT的步骤
  详细解决方案

查看EXC_BAD_ACCESS或SIGABRT的步骤

热度:7690   发布时间:2013-02-26 00:00:00.0
查看EXC_BAD_ACCESS或SIGABRT的方法

本文出自:http://blog.csdn.net/linhanmin/article/details/8117808


1.打开XCode -> Product -> Edit Scheme 

2.选择Arguements的Environment Varibles中添加NSZombieEnabled YES


测试代码

UILabel *label = [[UILabelalloc]initWithFrame:CGRectMake(0,0,102,102)];

[label release];

[self.view addSubview:label];


使用前结果:

-[NSPathStore2 frame]: unrecognized selector sent to instance 0x1f55eff0

 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 frame]: unrecognized selector sent to instance 0x1f55eff0'

代码跳回main函数


使用后:

 -[UILabel superview]: message sent to deallocated instance 0x1fd30540