简体   繁体   中英

should I set strong IBOutlet to nil when receive memory warning under ARC?

In ios6 should I set strong IBOutlet to nil when receive memory warning? what about a view I declared as instance variables and added to the view hierarchy by code?

Since iOS6, Apple recommends not releasing views, just cached data that you can recover easily, such as downloaded images. This is why they deprecated viewDidUnload .

On top of Leo Natan's answer, it also wouldn't do you any good to just set the outlet to nil , as you would also need to remove the outlet from its superview. Before that you would need to check that the view property isn't visible (has no window property) as well as clearing out the view . It's complicated and unnecessary.

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