Why should you remove the observer in ios8?

After reading this post for iOS 9, I know that you no longer need to remove Observer.

However, for iOS 8, you need to remove the deinitObserver in the method for viewController. But I can’t figure it out. If viewController is freed, will DEAD not be? Why do we need to do removeObserver. This, as an observer, is very similar to calling a dead person who will never pick up the phone.

What? I do not understand?

+4
source share
2 answers

This is fully explained in the article you linked:

:

, , , (.. /, ), .

iOS 9 NSNotificationCenter weak, NSNotificationCenter , . . (, ), . , .

iOS 9, NSNotificationCenter . , , . , . , .

+9

,

!

, , . , , View Controller ? .

, , (, ) , - (, ).

: , ( ) ( ). , , , , . , - () , , . , , , .

+4

Source: https://habr.com/ru/post/1655642/


All Articles