Is there a way to convert NIB
files to XIB
files so that I can open them in Xcode 4? Once I have edited them, is there a way to convert them back to NIB
?

- 6,409
- 16
- 72
- 140
-
Did you try renaming? I thought NIB and XIB were different names for the same thing. – Sergey Kalinichenko Apr 08 '12 at 15:53
-
The serve the same purpose but have different formats. I know that Interface Builder, from Xcode 3.x, can convert them. I don't use Xcode 4, but I'm surprised to hear it won't open them. Perhaps [ibtool](https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/ibtool.1.html) can still convert them. – Ken Thomases Apr 08 '12 at 16:39
-
1Not necessarily. NIBs have existed in several formats before XIBs existed. It is true that XIBs are compiled to flattened/stripped NIBs during building, but those are not traditional NIBs. If you have a traditional NIB, then you can probably still edit it. However, if you're referring specifically to a flattened/stripped NIB, then see Rob's answer. – Ken Thomases Apr 08 '12 at 17:21
3 Answers
Once a nib file has been flattened and stripped (which is now a default part of the compilation process), then it is challenging to open it in IB. You may want to look at NibUnlocker, which is useful in converting a flattened nib file into xib, but it is not a lossless round-trip and it may not even work in all cases. As with most decompilers, much of the useful editing information has already been thrown away.
For more information on xib compilation, see ibtool(1).

- 286,113
- 34
- 456
- 610
-
1It's barely usable now. Unfortunately, neither `NibUnlocker` and `NibToXibConverter` are still maintained in the recent 5 or 6 years. – superarts.org Apr 16 '18 at 16:02
I have made a simple application to accomplish this task, here is the link: NibToXibConverter
Here is the code: NibToXibConverter@github
Hope it helps :-)

- 16,440
- 13
- 72
- 125
-
I've recently added an option to NibToXibConverter to decompile Nib's before converting to Xib's. – headkaze Feb 10 '14 at 10:31
-
@ecumedesjours will it be possible for you to share some sample xib and nib files, via drop box or at my email id - devarshi.kulshreshtha@gmail.com? Currently I am running on Mavericks, I will try to upgrade it to Yosemite to verify and resolve the crash. You can go ahead and create this as an issue in its github repository. I guess you might also be interested in helping me out in resolving the issue, feel free to submit the patch ;) – Devarshi Oct 03 '14 at 06:47
-
-
1Yes @ClairelyClaire, here is the link: https://github.com/Daemon-Devarshi/NibToXibConverter. Please note that I am not maintaining it from long time. – Devarshi Jan 18 '22 at 14:05
-
Thanks!! Were you able to make a XIB that actually could be recompiled to NIB? I'm trying to localize a compiled NIB menu file. – CXL Jan 21 '22 at 01:23
-
It's impossible to open a compiled "nib" file. I have tried to achieve that on a compiled nib file from an "ipa" downloaded from the AppStore with the tool "ibtool". Below is a result:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.ibtool.errors</key>
<array>
<dict>
<key>description</key>
<string>Interface Builder cannot open compiled nibs.</string>
<key>recovery-suggestion</key>
<string>Try opening the source document instead of the compiled nib.</string>
</dict>
</array>
</dict>
</plist>
This is a result of NibUnlocker App:
The document “MainViewController.nib” could not be opened. The NIB file “file://localhost/Users/xxx/MainViewController.nib” does not contain a keyedobjects.nib file. Perhaps it is of a later format that NibUnlocker does not yet recognize.

- 8,936
- 7
- 53
- 93