How to open settings from my iPad application (Objective-C) [duplicate]

白昼怎懂夜的黑 提交于 2019-12-18 16:58:21

问题


I've tried using:

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

And options trading all you see here:

examples

But I can not make it work.


回答1:


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

EDIT

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

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

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



来源:https://stackoverflow.com/questions/25558836/how-to-open-settings-from-my-ipad-application-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!