tags:

views:

392

answers:

5

I want to create a new nib file in the xcode 3.0 , but I found that I can create the xib file only , why ?

+3  A: 

In the Interface Builder Save As… dialog, you can choose to save as a Xib or a Nib. However, a xib file can do anything a nib can and more. In fact, xibs are compiled to nibs when your app is built. So unless it's a backward compatibility issue with the project, you might want to consider xib.

Chuck
And, if I'm not mistaken, the NIBs compiled from XIBs can't be opened in Interface Builder, which prevents your end users from mucking about with your UI.
Alex
@Alex: that's a shame. I loved to customize apps this way, and it helped me a lot to see how others are designing their nibs.
porneL
+2  A: 

By default Xcode will create a new format xml nib file (aka an .xib file).
If you want a .nib file then once the doc is created use the 'Save As' in the Interface Builder and select 'Interface Builder Cocoa Document (NIB 3.x)' or 'Interface Builder Cocoa Document (NIB 2.x)' from the file type drop down

Petesh
A: 

.xib files have another advantage over .nib files - thy are stored in text based xml format. This makes working with version control systems easier.

Although you shouldn't try and write/edit the .xib file directly; if there is a merge conflict you are sometimes able to figure out the conflicting change by looking at the diff file.

Abizern
A: 

Don't worry about it. Xcode will compile the xib to a nib when it builds your app.

Peter Hosey
A: 

Ok , I found the method to convert a xib files to nib . because a backward compatibility issue with the project, so I have to do it .

jin