iOS - NSNotificationCenter memory leak

2019-05-22 14:20发布

问题:

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.