创建没有NIB文件的Cocoa应用程序 [英] Creating a Cocoa application without NIB files

查看:242
本文介绍了创建没有NIB文件的Cocoa应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我知道这违反了整个MVC原则!

Yes, I know this goes against the whole MVC principle!

但是,我只是想鞭打一个非常简单的应用程序 - 我漂亮很多实现它。但是,我有一个问题...

However, I'm just trying to whip up a pretty trivial application - and I've pretty much implemented it. However, I have a problem...

我创建一个空项目,复制所有框架并设置构建设置 - 我收到关于可执行文件的错误,缺乏可执行。构建设置看起来很好,但它告诉我没有可执行文件 - 它将构建+运行罚款。但是它不运行。没有任何错误 - 它只是看起来运行非常快,干净!除非我尝试运行GDB,礼貌地告诉我,我需要先给它一个文件..

I create an empty project, copy all the frameworks over and set the build settings - and I get errors about the executable, or lack of executable. The build settings all appear fine, but it tells me there is no executable - it will build + run fine. However it doesn't run. There is no error either - it just appears to run very fast and cleanly! Unless I try and run GDB which politely tells me I need to give it a file first..

Running…  
No executable file specified.  
Use the "file" or "exec-file" command.

所以我创建了一个Cocoa应用程序,删除了所有我不需要的东西(也就是说, MainMenu.xib file ..),现在我可以完全编译我的代码。

So I created a Cocoa application, removed all the stuff I didn't need (that is, the MainMenu.xib file..), and now I can compile my code perfectly. However it dies complaining that it's

我经历了项目符号,看到代码实际上依赖于NIB文件,即使你不触摸它的代码。 (MVC再次我猜..)

I have gone through the Project Symbols and see that the code actually relies upon the NIB file heavily, even if you don't touch it code-wise. (MVC again I guess..)

有一个简单的方法来编译只是你编写的,没有添加的NIB文件,只是代码你写的和你添加的框架?

Is there a simple way to compile just what you code, no added NIB files, just the code you write and the frameworks you add? I assume it would be a blank project, but my experience tells me otherwise?!

推荐答案

当然,你可以编写代码和代码,不使用Interface Builder。

Of course you can write just code and not use Interface Builder.

您有检查您的Info.plist吗?默认情况下,有一个条目MainMenu.xib,它可能是引用它抱怨。

Have you checked your Info.plist? By default there is an entry there for MainMenu.xib and it may be that reference it's complaining about.

这篇关于创建没有NIB文件的Cocoa应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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