简体   繁体   中英

To nil out outlets in a custom UIView's dealloc under ARC?

Usually in a UIViewController subclass, I nil out all outlets in viewDidUnload. But in my custom UIView, should I nil out those outlets (defined in my custom UIView) in dealloc instead? Does ARC perform these actions automatically?

No, still do it in viewDidUnload to get them out of memory as fast as possible.

ARC means you don't need to do it anywhere but it's still a bit more efficient if you do.

Though you don't ever need to nil properties in deadlock when using arc in any of your classes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM