问题
I'm receiving a SIGABRT error when attempting to run my application on my iPhone 5. My application basically requires 3 views, and depending on which device you're running (iPhone 4, iPhone 5 or iPad), it will launch the view specific to your device type.
The SIGABRT error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController_Portrait5" nib but the view outlet was not set.'
I'm almost positive that the view outlet was set, but I guess I'm wrong.
Here is a screenshot of Xcode window:
回答1:
You need to connect the "view" outlet. See how there is an item in that list "view" with no connection? You need to ensure that every UIViewController is connected to a view.
Since you named the file "portrait" I'm guessing that you'd like the view to be the portrait view, so connected the "view" outlet with the "Portrait" object, under "Objects."
回答2:
Just drag the little circle next to "view" above your "webView" to the first view.
来源:https://stackoverflow.com/questions/13780016/sigabrt-error-view-outlet-was-not-set