message sent to deallocated instance
在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];
|
原文地址:http://www.devdiv.com/lldb_message_sent_to_deallocated_instance_-blog-50901-50856.html
message sent to deallocated instance的更多相关文章
- 捉襟见肘之message sent to deallocated instance 0x16f62a70
出现的问题(真机ios8到ios9测试没有问题,真机ios7.1出现问题): -- :::60b] *** -[ChatViewController scrollViewDidScroll:]: me ...
- 如何在LLDB下排查message sent to deallocated instance问题
转:http://www.devdiv.com/home.php?mod=space&uid=50901&do=blog&id=50856 在XCode的以前版本中,如果遇到了 ...
- runtime MethodSwizzle 实践之 奇怪crash : [UIKeyboardLayoutStar release]: message sent to deallocated instance
情景: 使用MethodSwizzle 实现对数组.字典 等系统方法的安全校验.显然能达到预期效果,但实际发现当 键盘显示的情况下 home app 进入后台,再单击app 图标 切换回前台时 发 ...
- 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的信息,根本没办法定位问题出现在哪里.通常这样的崩溃出现,原因一般就是:调用了已经释 ...
- 解决LLDB模式下出现message sent to deallocated instance错误
本文在源文的基础上做整理:http://www.devdiv.com/home.php?mod=space&uid=50901&do=blog&id=50856 Xcode版本 ...
- [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份钟左右就强制退 ...
- Xcode调试之exc_bad_access以及 message sent to deallocated instance
如果出现exc_bad_access错误,基本上是由于内存泄漏,错误释放,对一个已经释放的对象进行release操作.但是xcode有时候不会告诉你错误在什么地方(Visual Studio这点做得很 ...
随机推荐
- 委托、Lambda表达式、事件系列01,委托是什么,委托的基本用法,委托的Method和Target属性
委托是一个类. namespace ConsoleApplication1 { internal delegate void MyDelegate(int val); class Program { ...
- Auto Layout on iOS Versions prior to 6.0
使用XCODE5.0,出现这个小错误... 解决办法: 选中你的XIB或storyboard,如下图 再查看右边属性栏 去掉最下边的Use Autolayout ,完成. 转:http://blog. ...
- NSString 和 NSData 转换
NSString 转换成NSData 对象 NSData* xmlData =[@"testdata" dataUsingEncoding:NSUTF8StringEncoding ...
- Linux下eclipse编译C/C++程序遇到 undefined reference to `pthread_create'的异常解决办法
解决方法:右键点击的当前project—>properties—>C/C++ Build—>Settings—>Tool Settings选项卡—>GCC C Linke ...
- 手机端可以和PC端同时在线-java QRCode 实现网站扫码登录(即支持同帐号多设备同时登录)
微信扫码测试地址:: http://sms.reyo.cn 用户名:aa 密码:123456 扫码登录实现方式很多,比如ajax轮询,http长连接(comet...),websocket,event ...
- java如何直接返回excel到客户端
既然是web项目首先你得拿到响应才能向外部写出,你得拿到响应对象response,1.添加如下两行代码response.setContentType("application/vnd..ms ...
- HttpAsyncClient的连接池使用
代码示例 public static void main(String[] args) throws Exception { ConnectingIOReactor ioReactor = new D ...
- C#中的自动赋值
工作中用到对同一个类型的对象的赋值,需要逐个属性的赋值赋过去,在网上找了很久没发觉合适的,就自己动手写了个,以做备忘用. protected void AutoAssign(object from , ...
- FreePascal - Typhon在Windows10 X64下的使用问题!
Typhon是CodeTyphon中的开发FreePascal的IDE工具. 在Windows10 X64中安装完CodeTyphon后,我们会发现有两套Typhon,分别对应32位和64位,32位可 ...
- c++实现Xml和json互转【转】
https://blog.csdn.net/kfy2011/article/details/51774242 1.下载c语言的cJson库源码,库很小,只有两个文件cJSON.c和cJSON.h.下载 ...