No need, it is MRC that needs to empty (or release) the attributes in dealloc. Automatic reference counting means that the programmer does not need to do it manually. You can do a test, for example, class A has an attribute b that is class B, and then put breakpoints in the dealloc of A and B to see if they are released, unless there are references elsewhere. , or form a circular reference or the like.
It is recommended that you read the memory management part of the document: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html
In the dealloc method, what you should do is to release references to other objects and cancel the originally subscribed notifications such as KVO or NSNotificationCenter. Do not do anything else
No need, it is MRC that needs to empty (or release) the attributes in dealloc. Automatic reference counting means that the programmer does not need to do it manually. You can do a test, for example, class A has an attribute b that is class B, and then put breakpoints in the dealloc of A and B to see if they are released, unless there are references elsewhere. , or form a circular reference or the like.
It is recommended that you read the memory management part of the document: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html
In the dealloc method, what you should do is to release references to other objects and cancel the originally subscribed notifications such as KVO or NSNotificationCenter. Do not do anything else