终止另一个应用程序运行 - Cocoa [英] Terminating Another App Running - Cocoa

查看:131
本文介绍了终止另一个应用程序运行 - Cocoa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何终止正在cooca中运行的另一个应用程序。让我们说我有iTunes运行,我在我的应用程序中输入退出,它会退出itunes。 iTunes只是一个例子,它可以是用户想要的任何东西。



感谢

p> kevin

解决方案

如果您在Mac OS X 10.6,Snow Leopard上运行,可以使用新< =http://developer.apple.com/mac/library/DOCUMENTATION/AppKit/Reference/NSRunningApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/NSRunningApplication/terminate =nofollow noreferrer> NSRunningApplication终止方法。


How can I terminate another app that is running in cooca. Let's say I have iTunes running, and I type in quit in my app, it would quit itunes. "iTunes" is just an example, it could be anything the user wants. I can open any app from my application, but I want to know how to close any app running.

thanks

kevin

解决方案

If you're running on Mac OS X 10.6, Snow Leopard, you can use the new NSRunningApplication terminate method.

这篇关于终止另一个应用程序运行 - Cocoa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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