标签:
iOS8以后,苹果允许从应用内跳转到系统设置,但是调试结果表明,跳不到具体的设置项,使用前应该判断当前是否能够跳转到系统设置。
代码:
1 NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; 2 if ([[UIApplication sharedApplication] canOpenURL:url]) { 3 [[UIApplication sharedApplication] openURL:url]; 4 }else{ 5 6 }
贴一下不能用的 iOS5 的用法:
1 //location 2 NSURL *url = [NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]; 3 if ([[UIApplication sharedApplication] canOpenURL:url]) { 4 [[UIApplication sharedApplication] openURL:url]; 5 }else{ 6 NSLog(@"there...."); 7 }
1 About — prefs:root=General&path=About 2 Accessibility — prefs:root=General&path=ACCESSIBILITY 3 Airplane Mode On — prefs:root=AIRPLANE_MODE 4 Auto-Lock — prefs:root=General&path=AUTOLOCK 5 Brightness — prefs:root=Brightness 6 Bluetooth — prefs:root=General&path=Bluetooth 7 Date & Time — prefs:root=General&path=DATE_AND_TIME 8 FaceTime — prefs:root=FACETIME 9 General — prefs:root=General 10 Keyboard — prefs:root=General&path=Keyboard 11 iCloud — prefs:root=CASTLE 12 iCloud Storage & Backup — prefs:root=CASTLE&path=STORAGE_AND_BACKUP 13 International — prefs:root=General&path=INTERNATIONAL 14 Location Services — prefs:root=LOCATION_SERVICES 15 Music — prefs:root=MUSIC 16 Music Equalizer — prefs:root=MUSIC&path=EQ 17 Music Volume Limit — prefs:root=MUSIC&path=VolumeLimit 18 Network — prefs:root=General&path=Network 19 Nike + iPod — prefs:root=NIKE_PLUS_IPOD 20 Notes — prefs:root=NOTES 21 Notification — prefs:root=NOTIFICATIONS_ID 22 Phone — prefs:root=Phone 23 Photos — prefs:root=Photos 24 Profile — prefs:root=General&path=ManagedConfigurationList 25 Reset — prefs:root=General&path=Reset 26 Safari — prefs:root=Safari 27 Siri — prefs:root=General&path=Assistant 28 Sounds — prefs:root=Sounds 29 Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINK 30 Store — prefs:root=STORE 31 Twitter — prefs:root=TWITTER 32 Usage — prefs:root=General&path=USAGE 33 VPN — prefs:root=General&path=Network/VPN 34 Wallpaper — prefs:root=Wallpaper 35 Wi-Fi — prefs:root=WIFI 36 Setting —prefs:root=INTERNET_TETHERING
其他有待测试,未完待续。。。
标签:
原文地址:http://www.cnblogs.com/yingu/p/5035204.html