본문 바로가기

Develop/Objective-C

ios library memory leak (apple frameworks)


Q) how to solve Instruments detected leaks whose responsible library is
 

    Apple's framework?

A1) 

Well Apple Developers are also human, and they also can make mistakes. Alternative would be to create your own framework exactly same to that of Apple's but that will not be nice thing to do as Apple will certainly come up with upgrades and fixes in future that will resolve the issues.

The only solution would be to report bugs to Apple about memory leaks, even I have seen that framework has lots of memory leaks.

There are also other reasons for memory leaks, instruments may show memory leaks in apple's framework, but it is not necessary that it is caused by the framework's bad code, indeed it could be the bug in our code where we did not follow correct steps, for example we add observers but we do not remove them, we bind for events but we do not remove them, so if we have not done cleaning operations correctly, instruments may show leak but somewhere else.



A2) 

I've been noticing the same with one of my apps and in the end, after trying to figure out what I am doing wrong, I came to the conclusion I'm doing nothing wrong and that Apple's frameworks have memory leaks as well.

So I don't think there's anything you can do.

 

참조 : http://stackoverflow.com/questions/3913431/how-to-solve-instruments-detected-leaks-whose-responsible-library-is-apples-fram 

애플의 실수란 말인가..