NSWorkspace runningApplications不返回我的XPC mach服务 [英] NSWorkspace runningApplications doesn't return my XPC mach service

查看:325
本文介绍了NSWorkspace runningApplications不返回我的XPC mach服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NSArray *activeApps = [[NSWorkspace sharedWorkspace] runningApplications];

返回正在运行的应用程序和代理,但我看不到我正在运行的XPC mach服务即使在活动监视器中查找PID时,也会显示在活动监视器进程中)

Returns running applications and agents, but i cannot see my running XPC mach service (although it is running and visible in activity monitor processes)

id res = [NSRunningApplication runningApplicationWithProcessIdentifier:223];

我得到结果,虽然与其他进程,这工作很好

i get res nil, although with other processes this works well

推荐答案

NSRunningApplication文档说明:


只有用户应用程序跟踪这不提供关于系统上的每个进程的信息

Only user applications are tracked; this does not provide information about every process on the system

你想完成什么?您不需要以这种方式检查服务。

What exactly you trying to accomplish? you dont need to check for a service in this way.

这篇关于NSWorkspace runningApplications不返回我的XPC mach服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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