When does an associated object get released?

前端 未结 4 1873
无人及你
无人及你 2020-11-27 12:32

I\'m attaching object B via associative reference to object A. Object B observes some properties of object A through KVO.

The problem is that object B seems to be d

4条回答
  •  执念已碎
    2020-11-27 12:38

    The accepted answer to this related question explains the deallocation timeline of objects. The upshot is: Associated objects are released after the dealloc method of the original object has finished.

提交回复
热议问题