Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"loaded nib but the view outlet was not set" exception

Tags:

I am trying to use UINavigationController. I have two views which are being created programmatically. When a UIButton is pressed on the first view, the second view should come to foreground.

But here application crash with exception:

loaded nib but the view outlet was not set

What can be cause of this and how to resolve it.

like image 386
erdemgc Avatar asked Jun 26 '13 13:06

erdemgc


People also ask

How to set a view outlet xcode?

In the right-hand sidebar, click on the last tab--the one that looks like a circle with an arrow in it. You should see "outlets" with "view" under it. Drag the circle next to it over to the "view" icon on the left bar (bottom one, looks like a white square with a thick gray outline. Save the xib and re-run.

How do I load a nib in Swift?

mainBundle(). loadNibNamed("SomeObject", owner: self, options: nil) self. addSubview(self. view); // adding the top level view to the view hierarchy } required init(coder aDecoder: NSCoder) { super.


1 Answers

follo following steps

1) open your xib file then right click on files owner and drag to your first view

enter image description here

2) then bind that view with outlet of "view"

enter image description here

hope you will get it...

like image 98
Nirav Gadhiya Avatar answered Sep 20 '22 16:09

Nirav Gadhiya