Welcome to the Treehouse Community
Looking to learn something new?
Why do we make SignUpViewContorller's text field's weak?
In previous app's we always made the text fields have the strong property but in this video, it was not clear to me why we made the text fields weak.
Stone Preston42,016 Points
you use the weak attribute when you have a parent child relationship. The text fields superView has a strong pointer to its subviews and its subviews will be retained as long as the superview exists, so you dont need to use strong for the outlet as well. If you did you would have whats known as a retain cycle (the textfield would continue to exist in memory even though its parent view is gone) . You generally use weak for all outlets since they are part of a parent child relationship.