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.
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.
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.
follo following steps
1) open your xib file then right click on files owner and drag to your first view
2) then bind that view with outlet of "view"
hope you will get it...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With