【发布时间】:2012-03-17 05:27:25
【问题描述】:
我想从如下所示的警报启动设置应用程序:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{ NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
if([title isEqualToString:@"Ok"])
{
NSLog(@"Ok was selected.");
}
else if([title isEqualToString:@"Safari"])
{
NSLog(@"open Safari was selected.");
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]];
}
}
我使用了 prefs:root=General,但后来我从下面的链接中阅读...
iOS Launching Settings -> Restrictions URL Scheme
...这在 ios5.1 中是不可能的。事实上它在模拟器中不起作用。我能做些什么??感谢您的帮助
【问题讨论】: