开发者

how to find objects with autorelease message?

开发者 https://www.devze.com 2022-12-08 00:01 出处:网络
My application crashes when the autorelease pool is released. The reason seems to be that the object with autorelease message is sent a release message sometime before the pool is released, hence the

My application crashes when the autorelease pool is released. The reason seems to be that the object with autorelease message is sent a release message sometime before the pool is released, hence the application crashes for object which is already released.

Hence I want to find which objects have a pending autorelease message, so that I can balance the retain .. release/aut开发者_StackOverflow中文版orelease messages to that object


if you dont know about 'NSZombieEnabled' you definitely need to check it out - Instructions are here

It won't tell you which objects are in the autoreleasepool but it will tell you which objects are being over-released.

In brief:

1)Double-click an executable in the Executables group of your Xcode project.

2)Click the Arguments tab.

3)In the "Variables to be set in the environment:" section, make a variable called "NSZombieEnabled" and set its value to "YES".

0

精彩评论

暂无评论...
验证码 换一张
取 消