How to add new xib files

ilaunchpad picture ilaunchpad · Aug 23, 2011 · Viewed 45.5k times · Source

I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file?

Answer

codelark picture codelark · Aug 23, 2011

(Assuming XCode 4)

In the "File -> New File..." menu dialog, there is a subsection called "User Interface."

You will notice in the description of each of the sub-items, it says "An Interface Builder Document." Those are various types of nibs.

If you're creating a new ViewController specifically, you can also choose the "Cocoa Touch" section and select the "UIViewController subclass" item. There is a checkbox in the next page called "With XIB for User Interface." which will create the NIB as well as the associated class files.