Seeing a weirdness with SMLoginItemSetEnabled whereby instead of launching the helper application in MyApp.app/Contents/Library/LoginItems it's actually launching a second instance of the parent application (MyApp.app)
Code is very simply:
SMLoginItemSetEnabled(HelperConstant.loginLauncherBundleId as CFString, true)
where the bundle id is defined as
static let loginLauncherBundleId = "com.company.loginlauncher"
When I do
SMLoginItemSetEnabled(HelperConstant.loginLauncherBundleId as CFString, false)
it kills the second instance of the parent application.
Does anyone have any idea why this might be happening?
It’s 100% reproducible on a fresh machine (at least in a parallels VM).
Well, that’s clearly a bug, and I encourage you to file it as such. Please post your bug number, just for the record.
Is this only triggered by you moving the app programmatically. That is, if you skip step 2 do you see the problem?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"