Objective-C"消息被发送到解除分配的实例0x5633b0" [英] Objective-C "message sent to deallocated instance 0x5633b0"

查看:145
本文介绍了Objective-C"消息被发送到解除分配的实例0x5633b0"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的obj-C应用程序似乎有一些过于热心的释放 - 收到错误消息

I appear to have some overzealous releasing going on in my obj-C app - getting error message


- [myobj release] :消息发送到解除分配的实例0x5633b0

"-[myobj release]: message sent to deallocated instance 0x5633b0"

。我知道导致问题的对象实例的类,但是这个类被用来创建许多实例。

. I know the class of the object instance causing the problem, but this class is used all over to create many instances.

我的想法是我可以在init中添加一些日志记录记录任何0x5633b0对应的类的方法应该帮助我追踪创建实例的位置。

My thought is I could put some logging in the init method of the class to log whatever "0x5633b0" corresponds to which should help me track down where the instance is being created.

0x5633b0到底是什么?我可以通过任何方式访问代码中的该值来记录它吗?

What exactly is the "0x5633b0" and is there any way I can get access to that value in the code to log it?

谢谢。

推荐答案

0x5633b0 可能是相关对象的地址( self 的值)。您可以使用 NSLog printf %p 一起打印它。

0x5633b0 is likely the address of object in question (the value of self). You can use NSLog or printf with %p to print it.

这篇关于Objective-C"消息被发送到解除分配的实例0x5633b0"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆