在Cocoa命令行程序中运行NSRunLoop [英] Run NSRunLoop in a Cocoa command-line program

查看:114
本文介绍了在Cocoa命令行程序中运行NSRunLoop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在不加载任何NIB文件的情况下初始化 NSRunLoop (即,不调用 NSApplicationMain()) ?

Is it possible to initialize a NSRunLoop without loading any NIB files (i.e., without calling NSApplicationMain())?

谢谢。

推荐答案

您可以编写自己的main方法并运行 NSRunLoop ,而不从 NSApplicationMain 返回。

Yes; you can write your own main method and run NSRunLoop without returning from NSApplicationMain.

请查看此链接;这个家伙在他的主要方法使用NSRunLoop,他不加载NIB文件,但它应该让你去与 NSRunloops

Have a look at this link; this guy is using NSRunLoop in his main method, he is not loading NIB files though, but it should get you going with NSRunloops.

这篇关于在Cocoa命令行程序中运行NSRunLoop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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