iOS - NSNotificationCenter memory leak

不羁岁月 提交于 2019-12-22 18:02:31

问题


Instruments reports this a memory leak (98.6%, whatever that means):

[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationSomeNotification object:self];

"self" is a subclass of UIImageView. Is including "self" in the notification causing a memory leak? If so, how do you resolve it?


回答1:


Better check your notification observer. The cause of memory leak might be there.




回答2:


Memory leaks are almost always it is not safe. Check again are there leakage accurately!? You can do this by using deleaker.



来源:https://stackoverflow.com/questions/4002080/ios-nsnotificationcenter-memory-leak

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!