I have a @class Foo
which contains a __weak id bar
ivar. Several actions from methods in different classes can cause the object to disappear and thus get bar
niled.
I want to perform an action when the ivar is automatically niled by ARC.
If possible, I would want to avoid turning bar
into a property or using Key-Value Observing.
Is this even possible? If not, can KVO be used against non-property ivars?
dealloc
, if possible I would also like to avoid usingbar
'sdealloc
method. I'd like to trigger this action within@class Foo
. – Abuttalsbar
into a property and using KVO. It doesn't hurt to ask, just in case. ;-) – Abuttals