I have an app where it seems to me that memory is not being release but I am not sure how to analyze this problem.
‘Analyze’ in xcode shows no problems and ‘Instruments’ does not show any memory leaks.
As far as I have seen, it is not recommended to look at the retain counts.
How can I find the problematic objects? I have added printouts to the object’s ‘dealloc’ method and do not see that this is being called.
Update
I am now getting that
objc[69139]: FREED(id): message retainCount sent to freed object=0x5422420
Is there an easy way to find out which object this is?
‘Analyze’ does not report any invalid releases.
I suggest searching through your code and finding every init/alloc statement. Then, verify for each object that it is getting released properly. If you have one problem, you likely have more. It may seem like a high cost initially, but it will likely pay off in fixed bugs.
A big thing to watch out for is references coming from nibs which you are also setting. It is very easy to have those not released. I find the easiest way to make sure there are no memory errors there is to declare them something like:
Then make sure dealloc is something like:
I did both of these a while back and all my memory errors cleared up.