When does an associated object get released?

前端 未结 4 1887
无人及你
无人及你 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:54

    Even larger than your -dealloc issue is this:

    UIKit is not KVO-compliant

    No effort has been made to make UIKit classes key-value observable. If any of them are, it is entirely coincidental and is subject to break at Apple's whim. And yes, I work for Apple on the UIKit framework.

    This means that you're going to have to find another way to do this, probably by changing your view layouting slightly.

提交回复
热议问题