Interface Builder and Xcode integration not working

11,570

Solution 1

I have been having the same problem and it's been driving me nuts.

Bizarrely, it seems to be caused by opening your project using the File > Open Recent Project menu in Xcode, or by using the Recent Documents list in the Xcode welcome screen.

If I double-click the project file in the Finder to open it or choose the project from the Recent Items menu in the Apple menu, Xcode's connection to Interface Builder is intact.

Does that help you?

Solution 2

I had this problem just now because I renamed my project from Project.xcodeproj to project.xcodeproj in the finder. I wanted to keep the new lowercase name so I opened the project.pbxproj file in a text editor and manually lowercased everything there too.

It still didn't connect to IB, so then I noticed that the XIB files contain this:

    <string key="IBDocument.LastKnownRelativeProjectPath">../../Project.xcodeproj</string>

So I changed that to:

    <string key="IBDocument.LastKnownRelativeProjectPath">../../project.xcodeproj</string>

That didn't fix it either!

Finally, I noticed that the path for the group (folder on the left panel of XCode) that contain my nibs was messed up. So, I opened the project again in my editor and fixed those, and finally it was fixed.

Hopefully something in there will help you :-)

Solution 3

Had the same problem .xib files not opening Interface Builder. Fixed by giong into Xcode, load your project up, right-click on your xxxx.xib file, doing to PREFERENCES at the bottom, then GENERAL PREFERENCES, then go to FILE TYPES across the top.

Then change the editor for .xib file types to something else e.g. Textwrangler - then APPLY, then, open up the xxxx.xib file in Textwrangler (or whatever) by double-clicking on it; then go back and change the editor to Interface Builder and APPLY.

Worked for me. Hope it works for you too! :)

Solution 4

This was driving me nuts for a couple hours today. Opening the project from Finder did the trick for me, but I haven't found an explanation for why this trick works. So I poked around a bit and I suspect it has something to do with tilde expansion. If I create a new project outside of my home folder, Xcode and IB have no problems.

This is what I've noticed: when I create a new project and save it anywhere under my own home folder (e.g. Documents), the path listed under the project in the "Welcome to Xcode" screen is "~/Documents". If I clear the "Open Recent Project" menu and then open the project via Finder, the project path is then shown as "/users/[username]/Documents". At this point, Xcode and IB work fine even if the project is opened via the Recent Projects list.

I suspect the Xcode<->IB sync is getting confused by the tilde and the reason it works fine when opened via Finder is that the path is expanded before being passed to Xcode (and then to IB).

One other trick I found was that when IB refuses to sync, opening the xib directly via IB's File->Open menu fixes it.

Solution 5

i tried all the above options , but nothing worked , I then removed and reinstalled xcode ,still nothin worked, I then installed xcode to a different location, now the things are working fine.

Share:
11,570
Martin Cote
Author by

Martin Cote

Graphics Engineer at Unity3D.

Updated on June 05, 2022

Comments

  • Martin Cote
    Martin Cote about 2 years

    After having installed the iPhone SDK 3.1.2, Interface Builder is not in sync with Xcode anymore. The light indicator at the bottom of the XIB window is grey. IB doesn't see any files from the Xcode project. Xcode is always open when I start IB.

    I tried rebooting. No luck.
    I tried removing the preferences files for Xcode/IB. No luck.
    I tried reinstalling Xcode/IB. Still no luck.

    This page explains how IB monitors the changes in Xcode. While it was an interesting read, it didn't provide any help about how to investigate my problem.

    Any help would be appreciated.

    EDIT
    Here's additional information. I enabled the debug logs for launchd, and I noticed the following line that appears every time Interface Builder is started:

    [0x0-0x1b01b].com.apple.InterfaceBuilder3[315]: Couldn't open shared capabilities memory GSCapabilities (No such file or directory)
    

    This really seems to be related to my issue.