2 Replies Latest reply: Sep 22, 2013 9:01 AM by ltaa09
ltaa09 Level 1 (30 points)

Im just starting to use xcode and actually just starting to learn ANY programing language so basicly ive created a hello world application then i wanted to take this a step further by creating a tab based application and doing little things to help myself learn the basics. So you have the 2 original view controllers with a tab bassed application, well i added 2 more view controllers and connected them to the tab bar controller (by the way took me forever to figure that out) now what i want to do is create the .h and .m files for the 2 more view controllers, how can i do this?? Oh and by the way im on the latest xcode version.

  • Llessur999 Level 4 (1,195 points)

    These detailed steps are for Xcode 4.6.3 but should be very similar in Xcode 5.


    1. Add a view controller to the storyboard of the desired type (ex: View Controller). [Drag from the Object Library.] I think you have already done this.


    2. Create a class module for the view controller. [File > New > File... > User Interface > iOS > Cocoa Touch > Objective-C Class.] Specify an appropriate class name (ex: FirstTabDetailsViewController), subclass from the same type used in step 1 (ex: UIViewController). Do not check XIB.


    3. Select the new view controller in the storyboard. Be sure the view controller is selected, not the view. Easiest way is to select in the Document Outline, not the design surface. In the Identity Inspector > Custom Class > Class, select the class name of the class you just created.



    4. Build to confirm everything is hooked up correctly.


    5. When you show the assistant editor for the storyboard, the new .h should appear.

  • ltaa09 Level 1 (30 points)

    Thanks! I figured out how right before you posted that .