ios - Why set retain on @property for subviews? -



ios - Why set retain on @property for subviews? -

fairly straightforward question in 2 parts.

if view retains subviews, , create view hierarchy in interface builder views nested within others, why iboutlet property nested subviews need set retain? wouldn't assign acceptable parameter subview properties?

i have uiview subclass adds few subviews upon initialization. capture references specific subviews, @property (nonatomic, assign) suffice need, correct? example, main uiview adds player score subview, later wants talk player score update it. reference needs assigned, view proper automatically retain uiview class, right?

1) doesn't need be. assign fine. made think have utilize retain?

2) yes

by way, using arc? if so, utilize weak instead of assign (please don't inquire why, explained in every corner of stack overflow , net in general).

ios cocoa properties retain assign

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -