在可可中查找已安装的应用程序 [英] Find Installed applications in cocoa

查看:103
本文介绍了在可可中查找已安装的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序在cocoa.I需要检查iTunes是否安装在机器上。有任何方法可以找到已安装的应用程序????

I am developing an application in cocoa.I need to check whether iTunes is installed or not in the machine.Is there any way to find the installed applications????

推荐答案

LSFindApplicationForInfo()函数可以获取一个包ID(例如 com.apple.iTunes ),是否通过尝试查找iTunes安装。

The function LSFindApplicationForInfo() can take a bundle ID (e.g. com.apple.iTunes), so you can find out whether iTunes is installed by trying to look it up.

http://developer.apple.com/DOCUMENTATION/Carbon/Reference/LaunchServicesReference/Reference/reference.html

要回答问题的第二部分, LaunchServices上的隐藏接口,以获取所有应用程序名称的列表。但是,因为你的目标是找到iTunes是否安装,不要使用它 - 只是寻找iTunes。

To answer the second part of your question, there is a hidden interface on LaunchServices to get a list of all application names. However, as your goal is to find whether iTunes is installed, don't use it - just look for iTunes.

这篇关于在可可中查找已安装的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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