简体   繁体   中英

IBOutlet why always weak and object of array ,dictionary etc are need to be strong

i am new in ios programming , i just want to know why we use IBoutlet of every controller to be weak and other Need to strong can we define IBoutlet to be strong ? if yes then what is difference ?

It has to do with ownership of the variable, since most IBOutlets are sub views of you view the ownership of the view lies with the view.

If you are creating your own properties you will need to retain the variable thus you make the property strong .

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