R – What are the differences between Xcode generated .nib/.xib and interface builder .nib/.xib template

interface-builderiphonexcodexib

I am new to iPhone development so I have been working through some tutorials. What I don't understand is how xib fit into the work flow.

In a tutorial, one of the instruction is to create a new UIViewController subclass with "XIB for User Interface" selected. On my first try, I neglected to check that option and I thought may be I can just create the xib in Interface Builder but that didn't work. ( I created the xib using Cocoa Touch View Template, with the same name as the UIViewController and saved it the into project directory so it was added to the project.) I even changed the Class Identify for the File's Owner and hooked up the view outlet (the two differences I noticed when I inspected the xib generated from Xcode.)

So what are the differences between Xcode generated .xib (from UIViewController Template) and the IB .xib template?

Best Answer

XIB files created as part of the New File flow in Xcode have their File's Owner class pre-set, as well as certain outlets (view) already connected. Otherwise, there's not much difference.