如何在LLDB下排查message sent to deallocated instance问题
转:http://www.devdiv.com/home.php?mod=space&uid=50901&do=blog&id=50856
在XCode的以前版本中,如果遇到了
[代码]c#/cpp/oc代码:
1 |
message sent to deallocated instance 0x6d564f0 |
我们可以使用info malloc-history 0x6d564f0来查看调用堆栈来查看崩溃发生的地方,这种方法这里不作阐述,大家自行百度。
[代码]c#/cpp/oc代码:
1 |
NSString *themePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:themePathTmp]; |
2 |
if(themePath) |
3 |
self.backgroundIV.image = [UIImage imageWithContentsOfFile:[themePath stringByAppendingPathComponent:@"mask_1.png"]]; |
4 |
|
5 |
[themePath release]; |
学过内存管理的人都应该知道在这里themePath并没有被retain,所以如果写了release,那么必然会发生崩溃情况。首先我们需要对开发的环境变量进行设置



我们打开终端,输入以下命令:
[代码]c#/cpp/oc代码:
1 |
sudo malloc_history 50127 0x6d564f0 |
结果显示为:

[代码]c#/cpp/oc代码:
1 |
NSString *themePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:themePathTmp]; |
[代码]c#/cpp/oc代码:
1 |
[themePath release];
|
如何在LLDB下排查message sent to deallocated instance问题的更多相关文章
- 解决LLDB模式下出现message sent to deallocated instance错误
本文在源文的基础上做整理:http://www.devdiv.com/home.php?mod=space&uid=50901&do=blog&id=50856 Xcode版本 ...
- message sent to deallocated instance
在XCode的以前版本中,如果遇到了 [代码]c#/cpp/oc代码: 1 message sent to deallocated instance 0x6d564f0 我们可以使用info mall ...
- 捉襟见肘之message sent to deallocated instance 0x16f62a70
出现的问题(真机ios8到ios9测试没有问题,真机ios7.1出现问题): -- :::60b] *** -[ChatViewController scrollViewDidScroll:]: me ...
- runtime MethodSwizzle 实践之 奇怪crash : [UIKeyboardLayoutStar release]: message sent to deallocated instance
情景: 使用MethodSwizzle 实现对数组.字典 等系统方法的安全校验.显然能达到预期效果,但实际发现当 键盘显示的情况下 home app 进入后台,再单击app 图标 切换回前台时 发 ...
- Xcode调试之exc_bad_access以及 message sent to deallocated instance
如果出现exc_bad_access错误,基本上是由于内存泄漏,错误释放,对一个已经释放的对象进行release操作.但是xcode有时候不会告诉你错误在什么地方(Visual Studio这点做得很 ...
- UICollectionView [NSIndexPath section]: message sent to deallocated instance
在UICollectionView上加UITapGestureRecognizer手势时,点击哪都报 [NSIndexPath section]: message sent to deallocate ...
- iOS内存错误EXC_BAD_ACCESS的解决方法(message sent to deallocated instance)
iOS开发,最郁闷的莫过于程序毫无征兆地就崩溃了,用bt命令打出调用栈,给出的是一堆系统EXC_BAD_ACCESS的信息,根本没办法定位问题出现在哪里.通常这样的崩溃出现,原因一般就是:调用了已经释 ...
- [CALayer release]: message sent to deallocated instance iOS内存过度释放问题
[CALayer release]: message sent to deallocated instance iOS内存过度释放问题 解决方式: 1:先找到过度释放的 内存指针 开启-僵尸模式:xc ...
- [UIImage _isCached]: message sent to deallocated instance
本文转载至 http://zhuhaibobb.blog.163.com/blog/static/2744006720124191633375/ 这几天做了个APP打开20份钟左右就强制退 ...
随机推荐
- MONGODB 与sql聚合操作对应图
MongoDB 高级查询条件操作符 2012-04-25 15:35:19| 分类: MongoDB | 标签:mongodb使用 mongodb查询 |举报|字号 订阅 http://blo ...
- Java中final的作用
Java中Final可以被用于变量,方法,类.具体来说: 1, Final 变量 修饰主类型时,制定变量为常数,不希望被改变 修饰类类型时,表示变量的句柄不变,不能被指定指向新的变量 修饰参数时,参数 ...
- Java - 简单的对象排序 - Comparator
注:对象排序,就是对对象中的某一字段进行比较,以正序或倒序进行排序. 例: 需要排序的对象: public class Person { public int age; public String n ...
- 2016年发布APASVO-p波震相自动拾取分析
Why automatic attractive? large amount of seismic data ; if manually,it depends om experience of ana ...
- jQueryMobile控件之ListView
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- struts2 标签 和 c标签的页面数据显示
用struts2 标签显示的页面代码 <s:if test="#request.employees == null || #request.employees.size() == 0& ...
- cas 在.net 下的单点登录实现及 ,Net Mvc的接入
最近在研究单点登录,发现用的最广的就是cas了,查了下资料,发现有人写了详细的说明 地址:http://www.cnblogs.com/zhenyulu/archive/2013/01/22/2870 ...
- php大力力 [037节] Iconfont-阿里巴巴矢量图标库
Iconfont-阿里巴巴矢量图标库 从此不求人:自主研发一套PHP前端开发框架 Iconfont-中国第一个最大且功能最全的矢量图标库,提供矢量图标下载.在线存储.格式转换等功能.阿里巴巴体验团队倾 ...
- 【LeetCode OJ】Distinct Subsequences
Problem Link: http://oj.leetcode.com/problems/distinct-subsequences/ A classic problem using Dynamic ...
- WPF的Binding学习笔记(二)
原文: http://www.cnblogs.com/pasoraku/archive/2012/10/25/2738428.htmlWPF的Binding学习笔记(二) 上次学了点点Binding的 ...