How to set the output for viewing using the tab bar controller in the iPhone SDK

In Xcode, I created a simple tab bar application.

There are 2 tab bar items in the default tab bar. I add the third element of the tab bar and set its view controller attribute to the view that I created and subsequently saved with the name ThirdView.xib.

When I try to start, the first two tabs work fine by default. The third one I added causes this error:

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ThirdView" nib but 
the view outlet was not set.'

I apologize for being a huge iPhone-SDK n00b, but no manner of dragging and dragging and dragging and dropping with the control allows me to set the view to the third view that I created.

+5
source share
3 answers

10 , xib:). XCode xib .

, , xib.

ThirdView.xib ( > > ) : " > view <". , - :

<object class="IBConnectionRecord">
    <object class="IBCocoaTouchOutletConnection" key="connection">
        <string key="label">view</string>
        <reference key="source" ref="372490531"/>
        <reference key="destination" ref="191373211"/>
    </object>
    <int key="connectionID">15</int>
</object>

, , ​​Interface Builder. . , .

+2

, initFromNib (, , ). .

+1

Using Xcode 4, I got this error because I did not set the NIB name for the Third button on the control panel. I fixed it by selecting the "Third" button and not the tab bar item inside the button, and using the Attribute Inspector, I set the name to NIB.

0
source

All Articles