如何从我的 iPad 应用程序打开设置 (Objective-C) [英] How to open settings from my iPad application (Objective-C)

查看:34
本文介绍了如何从我的 iPad 应用程序打开设置 (Objective-C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过使用:

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "prefs: root = General & path = Network"]];

您在此处看到的期权交易:

And options trading all you see here:

示例

但我不能让它工作.

推荐答案

Apple 不再允许开发人员从他们的应用程序(iOS 5.1 及更高版本)中打开设置"应用程序.

Apple no longer allows developers to open the Settings application from within their apps (iOS 5.1 and later).

编辑

根据下面@Mike 的评论,这可以在 iOS 8+ 中完成

According to @Mike's comment below, this can be done in iOS 8+

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

然而,在 iOS 8 之前使用它会导致崩溃.

Using this prior to iOS 8 will result in a crash, however.

这篇关于如何从我的 iPad 应用程序打开设置 (Objective-C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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