安装后第一次运行软件时,系统会弹出提示用户是否允许软件获取当前位置,如果用户不允许的话,之后运行时系统不会在弹出提示设置,这点很不方便,有个解决办法是给用户一个选项,调出iphone中“设置”定位服务选项,由用户手动设置,调用系统“设置”中定位服务相关代码如下:

-(IBAction)btnSetting:(id)sender{ 
    NSURL*url=[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]; 
    [[UIApplication sharedApplication] openURL:url]; 
}

还有其他调用系统设置的命令:
www.2cto.com

[font=]
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
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

收藏了以后看

原文链接http://www.devdiv.com/iOS_iPhone-ios_-thread-147180-1-1.html

最新文章

  1. .net的一致性哈希实现
  2. MySQL 复制表
  3. JS学习笔记--仿手机发送内容交互
  4. STM32 使用 FreeRTOS过程记录
  5. Linux grep与正则表达式
  6. 桌面每日一句--桌面翻译工具(有道翻译,微软翻译,Google翻译)
  7. 【python cookbook】【数据结构与算法】5.实现优先级队列
  8. 第十四篇、Ajax与Json
  9. HTTP协议之 简易浏览器(3)--转载
  10. Django建立helloworld自定义页面
  11. JavaEE Tutorials (13) - 使用锁定控制对实体数据的并发访问
  12. 关于java堆内存溢出的几种情况(转)
  13. USACO 1.5 Prime Palindromes
  14. jsp的开发模式
  15. HDU 5996 dingyeye loves stone [阶梯Nim]
  16. 螺旋打印2D数组
  17. shell编程基础(五): 正则表达式及其使用
  18. Docker——error pulling image configuration
  19. DAY15 模块
  20. 廖雪峰Java4反射与泛型-3范型-5extends通配符

热门文章

  1. jpa,jdbc,hibernate/mybatis,数据库驱动
  2. Linux用户和用户组管理 用户组管理命令
  3. 最新版express使用时的变化
  4. 【HackerRank】 Find Digits
  5. P4755 Beautiful Pair
  6. finally中的return
  7. 计数排序(COUNTING-SORTING)
  8. Windows Server 2008 IIS的备份和还原
  9. SpringBoot2.0之整合Kafka
  10. NCBI