Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
来源:互联网 发布:org域名值钱吗 编辑:程序博客网 时间:2024/05/16 12:26
1、添加MallocStackLoggingNoCompact,NSZombieEnabled,MallocStackLogging三个变量并且值全为YES
当出现message sent to deallocated instance的时候,一般伴随牛逼的BAD_ACCESS.是的,是某个对象release了两次。可是那么多的疑似对象,到底是哪一个?
使用xcode环境变量(添加方法请自行google)MallocStackLoggingNoCompact,NSZombieEnabled,MallocStackLogging这三个,值都设置成YES.寻求更详细的错误信息。
message sent to deallocated instance后会有一个内存地址,如:0×6497860,我们需要查看该地址的malloc history.查看方法,在原来的gdb下,使用”info malloc_history 0×6497860“即可显示malloc记录。但是新版的Xcode 不再支持,怎么办呢?秀逗麻袋,我们还有terminal,使用终端的malloc_history命令,如”malloc_history 32009 0×6497860“即可显示。其中的32009是该进程的pid,根据这个malloc记录,可以大致定位出错信息的代码位置。
2、在Terminal中 输入
malloc_history 32009 0xc9313d0 |grep 0xc9313d0
会出现类似以下提示代码,根据提示就可以找出错误具体位置
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
0 0
- Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
- Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
- Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
- message sent to deallocated instance问题的解决方法(gdb和lldb)
- message sent to deallocated instance问题的解决方法(gdb和lldb)
- message sent to deallocated instance问题的解决方法(gdb和lldb)
- message sent to deallocated instance问题的解决方法(gdb和lldb)
- 在LLDB下排查message sent to deallocated instance问题
- iOS开发 message sent to deallocated instance问题解决
- ios message sent to deallocated instance 重复release 内存问题
- 排查message sent to deallocated instance问题
- iOS内存错误EXC_BAD_ACCESS的解决方法(message sent to deallocated instance)
- iOS内存错误EXC_BAD_ACCESS的解决方法(message sent to deallocated instance)
- iOS内存错误EXC_BAD_ACCESS的解决方法(message sent to deallocated instance)
- 如何调试 message sent to deallocated instance 的问题
- 如何在LLDB下排查message sent to deallocated instance问题
- 如何在LLDB下排查message sent to deallocated instance问题
- 如何在LLDB下排查message sent to deallocated instance问题
- 递归入门(六) ---- 字符串翻转
- IE下判断IE版本
- 如何选择最好的视频眼镜的航空旅行
- MSDN里面的一些数据结构SYSTEMTIME、SYSTEM_INFO、MEMORYSTATUS、WIN32_FIND_DATA
- 字符集,字库,字符集实现
- Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
- 阿里云 yum 更新源
- Linux下rz/sz安装及使用方法
- 可重定位目标文件
- Javac源码简单分析之解析和填充符号表
- uva 10913 Walking on a Grid
- 如何选择最佳的廉价气枪狙击步枪
- CSS中position的absolute如何相对于父元素的位置进行定位
- MySQL sleep进程(一)