Weak and strong properties in -viewDidUnload under ARC

前端 未结 3 2028
无人及你
无人及你 2021-02-06 12:11

I am new to iphone development . I am using ARC for my project. As far as I understood using ARC we don\'t have to release any object manually. But , I have observed in some pla

3条回答
  •  生来不讨喜
    2021-02-06 12:58

    ARC will only release properties which do not hold a strong reference to an object. In your case, these are all strong references, so they will be kept unless they are explicitly set to nil.

    The viewDidUnload method does not mean that your UIViewController is removed from memory, it simply means that its views are removed from memory (iOS Developer - ViewController lifecycle).

    In this case, your UIViewController remains in memory, and therefore its properties as well, unless they are explicitly set to nil.

提交回复
热议问题