Take the 2-minute tour ×

I'm working in xcode and iOS, and I have an object that is not being deleted because some other object still has a reference to it, but I can't figure out who. Using Instruments, I see that it has a ref count of 1, but as far as I can tell from looking at my code, it should be zero.

I've run Instruments and it doesn't see it as a leak.

If there a way in Instruments (or in the debugger) to find out who still has the reference?

share|improve this question
Did you ever find the instrument to help you debugging? I am having the same problem now –  momo Aug 15 '12 at 23:43

2 Answers 2

Maybe you should try and replace some strong references to weak, and see if it still holds?

share|improve this answer

I guess we cannot help you very much in that case. Probably you have to follow the object through its intended lifecycle.

What you could try, is a category for NSObject, where you log every retain and release. You can also put breakpoints into these methods, so you see in the stacktrace (so from where it was retained/released).

share|improve this answer
I don't think under ARC the retain and release methods are called, not the traditional ones anyway. –  Roger Gilbrat Mar 11 '12 at 22:33
objc_release and objc_retain are called under ARC. –  JustSid Mar 11 '12 at 22:49

Your Answer


