SMLoginItemSetEnabled sometimes silently fails to launch sandboxed UI helper

前端 未结 3 1574
情歌与酒
情歌与酒 2020-12-31 11:36

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

3条回答
  •  悲哀的现实
    2020-12-31 12:09

    Is there any way to make SMLoginItemSetEnabled always use the login item from the current app bundle, rather than some random one elsewhere on the disk?

    It seems that there is is a bug in SMLoginItemSetEnabled. When I test my application, the executable is in the DerivedData folder of Xcode.

    When I build the release, I put the application and it's helper in the /Applications folder. But for some obvious reasons, the helper that is launched is the helper which is in the DeriveData folder. That's why I'm used to remove everything that is in this folder before launching the main application in /Applications.

提交回复
热议问题