SMLoginItemSetEnabled sometimes silently fails to launch sandboxed UI helper
问题 I have an app that is sandboxed, and includes a helper that presents some UI (as a full-screen window, but could be a status item or similar too). This works... most of the time. But sometimes it doesn't; it just silently fails to start the helper. Since the helper has UI, I use SMLoginItemSetEnabled to load it, then NSXPCConnection to communicate with it. But sometimes SMLoginItemSetEnabled fails to launch it, while still returning YES. This seems to be due to an old build of the app