NSWorkspace runningApplications doesn't return my XPC mach service

我只是一个虾纸丫 提交于 2019-12-11 01:36:50

问题


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

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

even when i look up the PID in activity monitor

id res = [NSRunningApplication runningApplicationWithProcessIdentifier:223];

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


回答1:


The NSRunningApplication documentation states:

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.



来源:https://stackoverflow.com/questions/26361106/nsworkspace-runningapplications-doesnt-return-my-xpc-mach-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!