1.iOS < 10
1)添加URL
2)跳转
NSURL *url = [NSURL URLWithString:@"prefs:root=WIFI"];
if ([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url];
}
2.iOS >= 10
用上面的方法会报错
-canOpenURL: failed for URL: "prefs:root=WIFI" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
只允许调到自己项目的设置页面:
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];