StartAtLoginController
StartAtLoginController copied to clipboard
SMCopyAllJobDictionaries is deprecated in OS X 10.10
SMCopyAllJobDictionaries is deprecated in OS X 10.10
According to the dev forums and this SO question there isn't currently a replacement.
As of WWDC 2017, Apple engineers have stated that this is still the preferred API to use.
To enable your app to compile wrap SMCopyAllJobDictionaries with the following:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CFArrayRef cfJobDicts = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
#pragma clang diagnostic pop
If this issue is important to your app and you'd like a resolution, please file a radar; this helps Apple engineers determine priorities of work items.
So I did file a radar on this, and got the following response:
Looking at the use of SMCopyAllJobDictionaries in StartAtLoginController, I see that it is used to retrieve the value of OnDemand key. That key is not related to SMLoginItemSetEnabled. Its value is the opposite of KeepAlive, please refer to man launchd.plist. SMJobIsEnabled is likely a better fit here.
However, I haven't been able to find documentation on SMJobIsEnabled and am therefore not sure how I'd go about updating this... maybe someone else here has more experience in this area?