zoukankan      html  css  js  c++  java
  • 通过应用打开系统中设置(定位权限,摄像头权限等等)

    方法一:

       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 字符串,其字符串就是方法二列举出来的

  • 相关阅读:
    怎样设定目标(六)如何时刻保持在目标的正确轨道上
    怎样设定目标(五)——设定目标失败的七大原因
    怎样设定目标(四)如何规划成功的新年目标
    怎样设定目标(三)——目标设定前的准备
    CMake笔记(一)
    开源IDE code blocks黑色主题
    函数指针
    getRealPath函数编译报错问题
    Intellij IDEA添加项目依赖
    structs2.8创建拦截器
  • 原文地址:https://www.cnblogs.com/handsomeBoys/p/5364330.html
Copyright © 2011-2022 走看看