I have a simple storyboard consisting of two UIViewControllers, with a segue connecting them.
UIVC1 --> UIVC2
I\'m trying to set a UILabel on UIVC2 to be eq
Your UILabel text is not being set because prepareForSegue
is being called before the IBOutlet for your label on the destination view controller is connected. So at that point the label is still nil
(and sending a message to nil
has no effect.)
What you should do instead is to create a new property on your destination view controller to store the string, and set this property in prepareForSegue
. Then in your destination view controller's viewDidLoad
method, use the value of that property to set the text
property of your UILabel.