从代码访问iOS设置 [英] Access iOS settings from code

查看:93
本文介绍了从代码访问iOS设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能的重复:

编程访问iPhone系统设置

如何从我的代码访问iPhone的设置?



如何访问iPhone的常规辅助功能设置

iPhone设置

[存取iPhone设定偏好设定]

代码查询iOS设置应用程序的某个设置?例如,我想知道多任务手势是否打开?或者甚至能够更改设置(从我的研究,似乎我绝对不能这样做)

Is there a way to, from my code query the iOS settings app for a certain setting? For example I want to know if "Multitasking Gestures" is turned on or not? Or even be able to change the settings?(From my research it seems like I definitely cant do this)

推荐答案

不。一般来说,您可以使用NSUserDefaults读取自己应用程式的偏好设定(无论是透过「设定」应用程式设定还是由应用程式设定)。但是,您不能读取其他应用程序的首选项,包括系统设置。在某些情况下,您可以使用特定于该设置的API来确定设置必须是什么,但在这种情况下,您仍然不应该假设您知道用户在设置应用中所做的选择。

No. In general, you can read your own app's preferences (whether they're set via the Settings app or by your app) using NSUserDefaults. You cannot, however, read the preferences for other applications, including system settings. There may be cases where you can figure out what the setting must be by using API specific to that setting, but in such cases you still shouldn't assume that you know what selection the user has made in the Settings app.

这篇关于从代码访问iOS设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆