查看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




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值