Hi!some time i release the particular object but still it shows Memory Leaks so which kind of condition should i give so that my memory related issue has been solved?that particular object is allocated in Application Delegate class and it's accessed from many View Controller so how should i remove that memory Leak?
views:
26answers:
1
+1
A:
The golden rule for memory management by reference counting is to concentrate on the scope, where the object is used. You retain it as long as you work with it and release it afterwards.
The whole rationale behind reference counting is to never issue more releases than retains for a certain scope. If you expect an object to get deallocated at a certain point and it doesn't, look for the root cause of the problem.
Could it be, that you erroneously assume a certain object to be autoreleased?
Hope this helps.
flitzwald
2010-06-29 07:46:52
is there any condition you know that by putting that condition i can release all allocated objects..i am worried about Application Delegates objects that crates leak throughout project please help me to solve this kind of Leaks...
Ankit Vyas
2010-06-29 08:02:04
@Ankit Vyas - Arbitrarily deallocating objects is a terrible idea and should never be done in practice. The reference counting memory management system is set up the way it is for a reason. If you are experiencing leaks, find the source of the problem rather than working on only the symptoms.
Brad Larson
2010-06-29 12:39:51