Interestingly, what is considered best practice in a situation where I need to read the contents of a controller UILabel/ UITextFieldfrom another between the two following possibilities:
1) Just create IBOutletin the UITextField.h file and make it publicly available for everyone
2) Create the NSString readonly property in the .h file, make it readwrite in the implementation file and update it every time you change private UITextField .
In my opinion, the second option looks better, because it supports OOP encapsulation, but there seems to be a lot of work with each UITextField / UILabelI have in each view controller.
Thoughts? Thank!
EDIT: Also, if I need to be able to install IBOutletsexternally as well in a method -(void)prepareForSegue:. So, I think the second option is the only option?
source
share