Who calls the dealloc method and when in Objective C?

前端 未结 4 719
深忆病人
深忆病人 2021-02-05 14:06

When a custom class is created in Objective C, when and how is the dealloc method called? Is it something that I have to implement somehow in my class?

4条回答
  •  粉色の甜心
    2021-02-05 14:52

    The runtime will do that for you when the object is no longer needed (which the runtime decides as well). Just make sure you retain and release properly. Do not call dealloc on other objects.

提交回复
热议问题