Xcode:Interface Builder XIB编译器错误 [英] Xcode: Interface Builder XIB Compiler Error

查看:1505
本文介绍了Xcode:Interface Builder XIB编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 5.1.1和OS X 10.9.3



我打开Xcode并启动一个新的Cocoa项目。然后点击运行。生成失败,并得到以下错误消息:

  Interface Builder XIB编译器错误
Interface Builder无法确定MainMenu.xib的类型。

当我选择 MainMenu时,我也看不到通常的WYSIWYG编辑器。 xib 只是一个黑色的屏幕。我注意到文件的类型是默认 - 抽象界面生成器文件,而在其他工作项目我建立在过去,类型是默认 - 界面生成器文件。似乎有一些关于它是一个抽象文件,导致Xcode不显示界面生成器。



我试图完全卸载Xcode并从App Store重新下载。没有帮助。多个谷歌搜索没有什么帮助,和其他Stack Overflow问题与我相似的标题没有光明。我不能想象其他人与Xcode 5.1有这个问题。任何专家在那里,可以建议一个快速解决?




< img src =https://i.stack.imgur.com/i81Tt.jpgalt =enter image description here>

解决方案

Aha!什么可笑的解决方案!希望这有助于某人。



添加新的xib文件!旧的 MainMenu.xib ,用于测量。新的xib将按预期显示。





但是等等 - 还有更多!

不确定是否只是因为我的Xcode是可怕的损坏,但这里还有我不得不做的,以使我的应用程序成功运行:



1 - 转到您的一般项目设置并将主界面设置为新的xib文件名称​​而不使用 .xib 扩展!否则,您将在控制台中输出无法加载nib文件。参见图片进行比较。这会在您运行程序时弹出空白的应用程序窗口。






2 - 现在你需要你的应用程序委托做事情。将对象从对象库中拖到界面构建器中的对象列表。将其类定义为应用程序委托类名称,对象应将自己重命名为App Delegate。





3 - 控制从应用程序拖动到 App Delegate 并选择delegate 。



4 - 添加一个 NSLog(@app success!); 语句在 applicationDidFinishLaunching 方法中确认你做的一切正确,点击运行,观察窗口弹出和NSLog输出到控制台,并祝贺自己做一个苹果产品工作它应该是设计工作的方式。


Xcode 5.1.1 and OS X 10.9.3

I open Xcode and start a new Cocoa project. I then click run. The build fails, and I get the following error message:

Interface Builder XIB Compiler Error
Interface Builder was unable to determine the type of "MainMenu.xib".

I also don't see the usual WYSIWYG editor when I select MainMenu.xib just a black screen. I notice the "type" of file is "Default - Abstract Interface Builder File", whereas on other working projects I have built in the past, the "type" is "Default - Interface Builder File". Seems there's something about it being an "abstract" file that's causing Xcode to not display the interface builder.

I tried fully uninstalling Xcode and re-downloading it from the App Store. Didn't help. Multiple google searches have turned up nothing helpful, and the other Stack Overflow questions with a similar title to mine aren't illuminating. I can't imagine everyone else with Xcode 5.1 has this issue. Any experts out there that could suggest a quick fix?

解决方案

Aha! What a ridiculous solution! Hope this helps somebody.

Add a new xib file!

And delete the old MainMenu.xib for good measure. The new xib will show up as expected.

But wait - there's more!

I'm not sure if it's just that my Xcode is horribly corrupted, but here's what else I had to do to get my application to run successfully:

1 - Go to your general project settings and set the Main Interface to your new xib file's name without the .xib extension! Otherwise, you'll get output in your console that says Unable to load nib file. See pics to compare. This will get your blank app window to pop up when you run the program.

2 - Now you need your app delegate to do stuff. Drag an Object from the object library to the list of objects in the interface builder. Define its class as your app delegate class name and the object should rename itself to 'App Delegate'.

3 - control drag from Application to App Delegate and select 'delegate'. Now your app delegate code will work.

4 - Add a NSLog(@"app success!"); statement in the applicationDidFinishLaunching method to confirm you did everything correctly, hit run, watch the window pop up and the NSLog output into the console, and congratulate yourself for making an Apple product work the way it should have been designed to work.

这篇关于Xcode:Interface Builder XIB编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆