码迷,mamicode.com
首页 > 其他好文 > 详细

通过应用打开系统中设置(定位权限,摄像头权限等等)

时间:2016-04-07 17:06:13      阅读:774      评论:0      收藏:0      [点我收藏+]

标签:

方法一:

   NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

    url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

    if ([[UIApplication sharedApplication] canOpenURL:url]) {

        [[UIApplication sharedApplication] openURL:url];

    }

 

//其中

UIApplicationOpenSettingsURLString  是一个字符串,定义在application文件中,相应的还有很多打开其他设置页面的static string 比如说定位设置等等。

 

 

方法二:

 

NSURL*url=[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"];  //定位设置的
    [[UIApplication sharedApplication] openURL:url]; 

 

//详见下表

Music — prefs:root=MUSIC
Music Equalizer — prefs:root=MUSIC&path=EQ
Music Volume Limit — prefs:root=MUSIC&path=VolumeLimit
Network — prefs:root=General&path=Network
Nike + iPod — prefs:root=NIKE_PLUS_IPOD
Notes — prefs:root=NOTES
Notification — prefs:root=NOTIFICATIONS_ID
Phone — prefs:root=Phone
Photos — prefs:root=Photos
Profile — prefs:root=General&path=ManagedConfigurationList
Reset — prefs:root=General&path=Reset
Safari — prefs:root=Safari
Siri — prefs:root=General&path=Assistant
Sounds — prefs:root=Sounds
Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINK
Store — prefs:root=STORE
Twitter — prefs:root=TWITTER
Usage — prefs:root=General&path=USAGE
VPN — prefs:root=General&path=Network/VPN
Wallpaper — prefs:root=Wallpaper
Wi-Fi — prefs:root=WIFI

 

About — prefs:root=General&path=About
Accessibility — prefs:root=General&path=ACCESSIBILITY
Airplane Mode On — prefs:root=AIRPLANE_MODE
Auto-Lock — prefs:root=General&path=AUTOLOCK
Brightness — prefs:root=Brightness
Bluetooth — prefs:root=General&path=Bluetooth
Date & Time — prefs:root=General&path=DATE_AND_TIME
FaceTime — prefs:root=FACETIME
General — prefs:root=General
Keyboard — prefs:root=General&path=Keyboard
iCloud — prefs:root=CASTLE
iCloud Storage & Backup — prefs:root=CASTLE&path=STORAGE_AND_BACKUP
International — prefs:root=General&path=INTERNATIONAL
Location Services — prefs:root=LOCATION_SERVICES

 

 

总结:

 方法一是系统帮我们定义的一个Static 字符串,其字符串就是方法二列举出来的

通过应用打开系统中设置(定位权限,摄像头权限等等)

标签:

原文地址:http://www.cnblogs.com/handsomeBoys/p/5364330.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!