Can't create new xib files in Xcode projects

Posted by Reed Olsen on Stack Overflow See other posts from Stack Overflow or by Reed Olsen
Published on 2010-02-09T17:57:10Z Indexed on 2010/05/23 15:31 UTC
Read the original article Hit count: 384

Filed under:
|
|
|
|

This one is a doozy...

My buddy just downloaded the iPhone SDK on his Snow Leopard MacBook Pro. No matter what kind of project he creates (Window Based, View Based, etc...,) he can't create or use his own xib files. The project will compile and run fine until he adds a new xib file.

Here are some symptoms:

  • When he selects a pre-generated xib in Xcode (such as MainWindow.xib), no preview is shown on the right hand side. Double clicking on this file will open it in interface builder (This is correct behavior).
  • When he selects his own custom xib, the preview pane displays the XML content of the xib. Double clicking on his custom xib opens up the XML file in Xcode - as if it were a standard code file (This is jacked up).
  • Opening his custom xib from finder opens it in Interface Builder.
  • When building the application, the build warning says something to the effect of "Warning: No rule to process file /path/to/CustomXib of type sourcecode.xib for architecture i386"
  • At runtime he gets the error:

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "MyCustomXib"'

We've uninstalled Xcode from the command line and reinstalled. I've verified that it's the right version for his machine. I'm stumped!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa