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

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

问题描述

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

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

谢谢.

推荐答案

Yes;您可以编写自己的 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天全站免登陆