What type of reference does NSNotificationCenter keep for 'observer's & 'object's?

前端 未结 2 1230
忘了有多久
忘了有多久 2021-02-07 04:16

Can anyone clarify/elucidate the situation with respect to -[NSNotificationCenter addObserver:selector:name:object:]?

  • What types of references are

2条回答
  •  攒了一身酷
    2021-02-07 04:40

    Current situation in 2016:

    iOS 9 has changed NSNotificationCenter such that it weak references the target object.

    That also to say you no longer have to removeObserver in when the object is dealloc.

提交回复
热议问题