Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMCopyAllJobDictionaries is deprecated in OS X 10.10 #12

Open
ixeau opened this issue Jan 7, 2015 · 3 comments
Open

SMCopyAllJobDictionaries is deprecated in OS X 10.10 #12

ixeau opened this issue Jan 7, 2015 · 3 comments

Comments

@ixeau
Copy link

ixeau commented Jan 7, 2015

SMCopyAllJobDictionaries is deprecated in OS X 10.10

@keith
Copy link

keith commented Jan 13, 2015

According to the dev forums and this SO question there isn't currently a replacement.

@BlindDog
Copy link

BlindDog commented Jun 9, 2017

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.

@danmessing
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants