Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode opens xib File as regular text file

Tags:

xcode

I have a Xcode project with .xib file. When I try to open them Xcode shows the plain text of these file, it does not show the Interface Builder Interface.

How can I make Xcode to show me what I want?

I have already cleaned the project and restarted my computer. Didn't help.

Screenshot of Xcode showing xib file as plain text

Please help me this.

like image 718
Vasu Avatar asked Jul 20 '13 07:07

Vasu


People also ask

How do I run XIB files in Xcode?

If you're trying to resolve any connection issues and have noticed that you need to edit a XIB file but have selected the Use Storyboards option when creating your project, simply right-click the Main. storyboard > click Open As > then click Source Code . This way you don't have to recreate the project from scratch.

What is an XIB file in Xcode?

What are XIB files? From the point of view of the UI designer, XIB files contain the views or windows that you design in Interface Builder – the controls, their layout and properties, and their connections to your code. It is important to understand that on a technical level, XIB files are stored object graphs.

Which data format do XIB files use?

Application interface created with Interface Builder, a graphical editor for designing and testing user interfaces; saved in a text-based flat-file format, introduced in Interface Builder 3.0. NOTE: XIB files are also called "development-time format" files.


2 Answers

The problem is that you have the version editor selected:

Xcode 6: version editor selected … Xcode 9: version editor selected

The version editor can only display source code. It can't display a xib graphically. You need to switch to the standard editor. Here are three ways to switch to the standard editor:

  • Press Command-Return.

  • Go to the menu bar and choose View > Standard Editor > Show Standard Editor.

  • Click the leftmost button in the “Editor” segmented control in the toolbar:

Xcode 6: standard editor selected … Xcode 9: enter image description here

like image 119
rob mayoff Avatar answered Oct 08 '22 15:10

rob mayoff


On the .xib file in the list of files, you can right-click and select Open As... and choose Source Code or Interface Builder.

like image 3
Phil Ringsmuth Avatar answered Oct 08 '22 17:10

Phil Ringsmuth