在iOS 8中从您的应用访问“设置”应用? [英] Accessing the Settings app from your app in iOS 8?

查看:96
本文介绍了在iOS 8中从您的应用访问“设置”应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过按钮或iOS 8中的任何内容从您自己的应用程序访问设置应用程序。我听说它在iOS 5中已经衰老,这是真的吗?如果没有在iOS 8中更改方法?如果没有其他方法可以解决这个问题,最好的方法是什么?

Is it possible to access the settings app from your own app via a button or whatever it may be in iOS 8. I heard that it got decrepitude in iOS 5, is that true? If not did the method change in iOS 8? If there is not other way to do this what would be the best way to work around it?

推荐答案

从iOS 8开始,您可以将应用中的用户直接带到设置应用中。它们将深入链接到您应用的特定设置页面,但它们可以退回到顶级设置屏幕。

As of iOS 8, it is possible to take a user from your app directly into the Settings app. They will be deep linked into your app's specific Settings page, but they can back out into the top level Settings screen.

如果您还支持iOS 7,则需要首先检查是否存在特定的字符串常量。

If you're also supporting iOS 7 you'll need to check first if a specific string constant is present.

更新:

如果您的部署目标设置为8.0或更高, Xcode 6.3会给你以下警告:

If your deployment target is set to 8.0 or above, Xcode 6.3 will give you the following warning:

Comparison of address of 'UIApplicationOpenSettingsURLString' not equal to a null pointer is always true

这是因为该功能从8.0开始可用,因此该指针永远不会是 NULL 。如果您的部署目标是8.0+,只需删除下面的if语句。

This is because the feature was available starting in 8.0, so this pointer will never be NULL. If your deployment target is 8.0+, just remove the if statement below.

if (&UIApplicationOpenSettingsURLString != NULL) {
    NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
    [[UIApplication sharedApplication] openURL:appSettings];
} 

这篇关于在iOS 8中从您的应用访问“设置”应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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