You cannot access IBOutlet
s of DetailViewController
in prepareForSegue
because they are not connected yet.
As mentioned in the comments create a String
property in DetailViewController
, set it in prepareForSegue
and set the text
property of the label in viewDidLoad
or viewWillAppear
of DetailViewController
.