Tuesday, November 9, 2010

How to Open Compiled .nib Files in Snow Leopard

When attempting to modify a file with Interface Builder, you'll possibly get the below error, particularly when editing system files:
"The document "LoginWindowUI.nib" could not be opened. Interface Builder cannot open compiled nibs. Try opening the source document instead of the compiled nib."
The problem comes from the .nib file not containing the classes.nib and login.nib files. The fix is pretty simple:
  1. First, download and unzip this, which has dummy versions of both needed files.
  2. Right-click on the file you want to edit and choose "Show Package Contents".
  3. A new window should come up, and there will be one file, keyedobjects.nib, listed.
  4. Copy classes.nib and login.nib into this folder.
  5. You should now be able to open the original .nib file.

13 comments:

Unknown said...

When I right click on the nib files I want to edit I don't see the "Show Package Contents" option. Any idea why?

Araignée said...

What .nib are you trying to edit? The .nib should likely have an Interface Builder Document icon.

If you are trying to do this on keyedobjects.nib, you don't need to. Simply drop the files into the same folder as that file, step back one level, and open the file.

daniblues said...

Still suffering same's Adam's problem... any idea?

Thanks for the tip :)

Araignée said...

What .nib (path, if possible, and application if applicable)? Can you navigate into the .nib using Terminal? What OS? Does this option never show up or just with this file?

Let me know...

Dominick said...

HEllo,

thank you very much for this information. I was finally able to open the .nib file.

However, another obstacle. I can not save any changes to the file. It says I don't have permission. I changed all permissions in all files (by clicking "get info" and then setting myself as the owner in bottom of get info window).

Do you know if this is a common problem?

Dominick said...

Hey! I don't know how but now it saves! Anyway, this thread was the only answer I could find on how to open the .nib file.

So, thanks a lot!

Sincerely,

-D

Araignée said...

I've never seen said problem. I'd be careful with changing permissions too much...and always work on a backup just in case.

Glad my post helped!

Anonymous said...

I am attempting to edit a system file .nib
I use a copy of that file and it does not have a "Show Package Contents" option.
Other .nib files do, at least the editable compiled ones.

Yes I can navigate to it in Terminal.
How can Terminal help me?

How did Dominick solve this problem?

Anonymous said...

I found the solution!
If you have a .nib file that does ~not~ have "Show Package Contents" available under right-click or control-click…

Then you get a working .nib file that is uncompiled and ~does~ have "Show Package Contents" available.
It must also have "classes.nib", "info.nib", and "keyedobjects.nib" within the package contents of this uncompiled .nib file.

Take the compiled .nib that you cannot open the package contents with.
Then rename it to "keyedobjects.nib"
Drop the new "keyedobjects.nib" into a working copy that contains the 3 .nib files named above.
Then open that .nib file with Xcode 4.1 or greater, or interface builder.
If it fails in interface builder, open with Xcode so it can be repaired.

Araignée said...

Thanks for the feedback and solution!

Anonymous said...

2023 失效了

Anonymous said...

2023 year it not work

Araignée said...

Yes, unfortunately in newer versions of macOS, it no longer works. The ".nib" files I've found are locked, and don't seem to have the some kind of content as they used to.

Post a Comment