开发者

Set System Preferences using Objective-C

开发者 https://www.devze.com 2023-02-18 09:48 出处:网络
This is probably trivial, however I couldn\'t find any information online: How can I set any Apple preference using code? I would like to create a little application for myself that sets certain prefe

This is probably trivial, however I couldn't find any information online: How can I set any Apple preference using code? I would like to create a little application for myself that sets certain preferences when I click a button. For instance I would like to turn off Bluetooth and Wi-Fi. As far as I know, these preferences are stored in /Users/fabian/Library/Preferences/com.apple.*.plist.

S开发者_运维知识库o: how can I change these preferences and make sure they are applied?


The CoreFoundation CFPreferences API allows for editing of defaults outside of the current application's defaults domain.

Note that you'll likely need administrative privileges to edit many network related defaults.

0

精彩评论

暂无评论...
验证码 换一张
取 消