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这点做得很 ...
随机推荐
- 任务失败,因为未找到“AxImpexe”,或未安装正确的 Microsoft Windows SDK
jenkins自动构建.net时发生错误,查看Console Output看到如下错误: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft ...
- hdu 4865 Peter's Hobby
Peter's Hobby Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) To ...
- lodash用法系列(4),使用Map/Reduce转换
Lodash用来操作对象和集合,比Underscore拥有更多的功能和更好的性能. 官网:https://lodash.com/引用:<script src="//cdnjs.clou ...
- List与Array之间互换
1 数组转换为List 调用Arrays类的静态方法asList. asList public static <T> List<T> asList(T... a) Return ...
- HttpSession javax.servlet.http.HttpServletRequest.getSession(boolean arg0)理解
request.getSession()和request.getSession(true)意思相同:获取session,如果session不存在,就新建一个 reqeust.getSession(fa ...
- 使用系统自带的 UIRefreshControl 实现下拉刷新
UIRefreshControl 为 UITableViewController 中的一个属性,从以下可以看出, IOS6.0 以上才支持. @property (nonatomic,retain) ...
- 迷失第一季/全集Lost 1迅雷下载
迷失 第一季 Lost Season 1 (2004)本季看点:影片主要讲述一架客机坠落在太平洋的孤岛上,48名乘客侥幸生还.面对这种荒芜人烟的小岛,他们如何才能生存下去呢?生还者形形色色,国籍.人种 ...
- Java并发编程的艺术(十一)——线程池(2)
Executor两级调度模型 在HotSpot虚拟机中,Java中的线程将会被一一映射为操作系统的线程. 在Java虚拟机层面,用户将多个任务提交给Executor框架,Executor负责分配线程执 ...
- MySQL Test Suite使用
MySQL Test Suite使用 MySQL自动测试套件(The MySQL Test Suite)用于对MySQL程序进行测试,包括各种功能与存储引擎.包含于MySQL与MariaDB版本代码中 ...
- Java Type Inference (类型推断)
public class Test2 { public static void main(String[] args) { ArrayList<String> list = newArra ...