Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 打开我的应用程序中的应用程序设置包_Ios_Application Settings - Fatal编程技术网

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设置

您必须自己构建它。这里有一些可能的解决方案: