Ios 打开我的应用程序中的应用程序设置包
我正在使用此代码显示应用程序设置Ios 打开我的应用程序中的应用程序设置包,ios,application-settings,Ios,Application Settings,我正在使用此代码显示应用程序设置 - (IBAction)showSettings:(id)sender { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; } 我想在我的应用程序中显示设置,而不是跳转到iPhone设置。 有人能帮忙吗 修改: 我尝试用目标C编写这段代码: UIAlertController *alertCon
- (IBAction)showSettings:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}
我想在我的应用程序中显示设置,而不是跳转到iPhone设置。
有人能帮忙吗
修改:
我尝试用目标C编写这段代码:
UIAlertController *alertControll = [UIAlertController alertControllerWithTitle:@"Sad Face Emoji!"
message:@"The calendar permission was not authorized. Please enable it in Settings to continue."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:@"Settings"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
[alertControll addAction:settingsAction];
[alertControll addAction:cancelAction];
[self presentViewController:alertControll animated:YES completion:nil];
但是仍然要跳转到iPhone设置您必须自己构建它。这里有一些可能的解决方案: