Je voulais lancer l'application des parameters d'une alerte comme vous voyez ci-dessous:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{NSSsortingng * title = [alertView buttonTitleAtIndex: buttonIndex];
if([title isEqualToSsortingng:@"Ok"]) { NSLog(@"Ok was selected."); } else if([title isEqualToSsortingng:@"Safari"]) { NSLog(@"open Safari was selected."); [[UIApplication sharedApplication] openURL:[NSURL URLWithSsortingng:@"prefs:root=General"]]; }
}
J'ai utilisé prefs: root = General, mais ensuite j'ai lu le lien ci-dessous …
Paramètres de lancement d'iOS -> Schéma d'URL de ressortingctions
… que ce n'est pas possible dans ios5.1. En fait, cela ne fonctionne pas dans le simulateur. Que puis-je faire?? Merci pour l'aide
Essayez ceci (fonctionne sur iOS 5 et plus):
[[UIApplication sharedApplication] openURL:[NSURL URLWithSsortingng:@"prefs://"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithSsortingng:@"prefs:root=General&path=Assistant "]];
Liste des URL actuellement connues dans l'application Paramètres:
prefs:root=General&path=About prefs:root=General&path=ACCESSIBILITY prefs:root=AIRPLANE_MODE prefs:root=General&path=AUTOLOCK prefs:root=General&path=USAGE/CELLULAR_USAGE prefs:root=Brightness prefs:root=General&path=Bluetooth prefs:root=General&path=DATE_AND_TIME prefs:root=FACETIME prefs:root=General prefs:root=General&path=Keyboard prefs:root=CASTLE prefs:root=CASTLE&path=STORAGE_AND_BACKUP prefs:root=General&path=INTERNATIONAL prefs:root=LOCATION_SERVICES prefs:root=ACCOUNT_SETTINGS prefs:root=MUSIC prefs:root=MUSIC&path=EQ prefs:root=MUSIC&path=VolumeLimit prefs:root=General&path=Network prefs:root=NIKE_PLUS_IPOD prefs:root=NOTES prefs:root=NOTIFICATIONS_ID prefs:root=Phone prefs:root=Photos prefs:root=General&path=ManagedConfigurationList prefs:root=General&path=Reset prefs:root=Sounds&path=Ringtone prefs:root=Safari prefs:root=General&path=Assistant prefs:root=Sounds prefs:root=General&path=SOFTWARE_UPDATE_LINK prefs:root=STORE prefs:root=TWITTER prefs:root=General&path=USAGE prefs:root=VIDEO prefs:root=General&path=Network/VPN prefs:root=Wallpaper prefs:root=WIFI prefs:root=INTERNET_TETHERING