In Objective-C, I understand that if an object sets itself as the delegate of another object, it should set that object's delegate to nil
in its dealloc
to avoid getting sent messages after it's gone.
However, when using Accessorizer (an Xcode utility), the stub code it generates also puts a delegate = nil
in the dealloc
of the class that has the delegate instance variable. What is the purpose of that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…