Unexpectedly found nil IBOutlet in prepareForSegue

You cannot access IBOutlets 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.

Leave a Comment