有没有办法使用 OSX cocoa NSApplication 方法 activateIgnoringOtherApps: 来激活已经加载的应用程序
这可能是一个愚蠢的问题,但看起来 activateIgnoringOtherApps: 可能是使用 Cocoa 激活应用程序的唯一方法。我有一个加载 Cocoa 应用程序的 java 应用程序,我希望在发生这种情况时激活 Cocoa 应用程序。问题是我不想启动中间应用程序(某种控制器)并使用此应用程序来激活IgnoringOtherApps:我的其他Cocoa应用程序。有没有办法使用 activateIgnoringOtherApps: 强制我的 Cocoa 应用程序变得活跃?
This may be a dumb question but it seems like activateIgnoringOtherApps: may be the only way to activate an app using Cocoa. I have a java app that loads up a Cocoa app and I want the Cocoa app to be activated when this happens. The problem is I do not want to have to launch an intermediate app (some sort of controller) and use this app to activateIgnoringOtherApps: my other Cocoa app. Is there some way to use activateIgnoringOtherApps: to force my Cocoa app to become active?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你不明白它是如何工作的。这是一个将从应用程序内部调用的方法,使其成为活动应用程序。您无法将此消息发送到另一个未运行的应用程序以使其启动。
I think you're not understanding how it works. This is a method that would be called from within the application to make it become the active application. You can't send this message to another application that isn't running to make it start.