Unable to create new xib files in Xcode projects

This is doozy ...

My friend just downloaded the iPhone SDK on his MacBook Pro Snow Leopard. No matter what project it creates (Window Based, View Based, etc.), it cannot create or use its own xib files. The project will compile and work fine until it adds a new xib file.

Here are some symptoms:

  • When it selects the pre-generated xib in Xcode (e.g. MainWindow.xib), the preview is not displayed on the right side. Double-clicking on this file will open it in the interface builder (this is the correct behavior).
  • When he selects his own xib, the preview pane displays the xib XML content. Double-clicking on its custom xib opens the XML file in Xcode - as if it were a standard code file (it was hacked).
  • Opening your custom xib from finder opens it in Interface Builder.
  • When creating the application, the assembly warning indicates the effect "Warning: there is no rule for processing the file / path / in / CustomXib of type sourcecode.xib for the i386 architecture"
  • At runtime, it gets an error:

    The application terminated due to the uncaught exception "NSInvalidArgumentException", reason: '- [UIViewController _loadViewFromNibNamed: bundle:] failed to load a nickname named "MyCustomXib"

Xcode . , . !

+3
5

, , directoy Tiger Snow Leopard. nib sourcecode.xib file.xib( nib, " " " " .

+1

...

: /path/to/CustomXib sourcecode.xib i386 "

... , nib - "Compile Sources". , " " , . , "Copy Bundle Resources" .

+1

xib "sourcecode.xib" "file.xib". "sourcecode.xib" , , ( ).

0

, , Xcode, OS X, , . Tiger Snow Leopard .

0

It seems my xib file was saved with the wrong file information when creating File-> New_file-> Subclassing UIViewController in Xcode.

When I changed the file information in the same way as for MainWindow.xib, and also moved it from the Target compilation folder, it worked fine; it is compiled and launched in the interface builder.

PS: I also upgraded directly from Tiger to Snow Leopard, so could it be a candidate for mixing Xcode settings?

0
source

Source: https://habr.com/ru/post/1732064/


All Articles