解决EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0) Xcode6

纯属个人总结

 EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0) 这种崩溃有时无任何征兆,我们可以打开Product->Scheme->Edit Scheme 按照如下图操作:

run->Diagnostics->Enable Zombie Objects 勾选上



重新定位问题,观察控制台是否有提示输出

如果没有继续以下操作(用模拟器调试):

1.还是Edit Scheme,切换到Tab Aguments 配置环境变量MallocStackLoggingNoCompact,NSZombieEnabled,MallocStackLogging 

重新定位问题,错位信息里会有一个内存地址,例如:message sent to deallocated instance 0x6497860,  在终端里输入malloc_history 40888 0x6497860 |grep 0x6497860  会出现以下提示

ALLOC 0xfcdff50-0xfce00b7 [size=360]: thread_3bf2a28 |start | main | UIApplicationMain | GSEventRun 
| GSEventRunModal | CFRunLoopRunInMode | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoObservers 
| __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ | _afterCACommitHandler | _applyBlockToCFArrayCopiedToStack 
| ___afterCACommitHandler_block_invoke | __38-[UITableView touchesEnded:withEvent:]_block_invoke |
 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] | -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] | -[MessageListViewController tableView:didSelectRowAtIndexPath:] | _objc_rootAlloc | class_createInstance | calloc | malloc_zone_calloc

-[MessageListViewController tableView:didSelectRowAtIndexPath:] 这个就是错误的位置

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值