Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder could not open the document ".xib" because it does not exist

I am localizing an app, following the steps listed here. I have successfully achieved that with around 45 .xib's, while just 4 of them gives me this error:

"Interface Builder could not open the document ".xib" because it does not exist."

when I move them from their original position. I try to move them from their Project/Classes/Example.xib position to the localized one on Project/en.lproj/Example.xib.

Why can't this .xib files be moved?

like image 324
MrSueko Avatar asked Jan 23 '12 08:01

MrSueko


3 Answers

For me it works like this:

  • select project target
  • remove the file from the build phases tab in copy bundle resources
  • re add it to the build phases tab
like image 62
Holger Avatar answered Oct 18 '22 20:10

Holger


I experienced the same error when running ibtools on .xib files in two different directories. It worked fine with the files in the first directory, but failed on the files in the second directory. If I swapped the order of processing the directories it still failed for the second directory.

Finally I discovered that ibtool starts a demon process ibtoold that doesn't terminate when ibtool finishes, and if I killed that process I no longer got the error. Apparently the demon has some state that hinders ibtool in working in another directory.

I used pkill ibtoold to kill the demon.

like image 12
jbiversen Avatar answered Oct 18 '22 19:10

jbiversen


I am having a problem using Xcode 5 that might be the same issue. ibtools is randomly working when generating or writing localized strings to/from xib files. I had to use sudo on some xib files to get it to work. Here's an example:

$ibtool --generate-strings-file en.lproj/MyVC.strings en.lproj/MyVC.xib
<?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 could not open the document "MyVC.xib" because it does not exist.</string>
    </dict>
</array>
</dict>
</plist>

Using sudo works although it complains about 'user domains will be volatile'

$sudo ibtool --generate-strings-file en.lproj/MyVC.strings en.lproj/MyVC.xib
2013-10-01 10:04:35.943 Interface Builder Cocoa Touch Tool[1717:303] CFPreferences: user       
home directory at file:///var/root/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.
$
like image 5
n8tr Avatar answered Oct 18 '22 19:10

n8tr