如何解决'UIAlertView' 已弃用:首先在 iOS 9.0 中弃用
else {
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil)
message:NSLocalizedString(@"Camera not available.",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK",nil)
otherButtonTitles:nil] show];
self.result(nil);
self.result = nil;
_arguments = nil;
}
}
我收到此错误,我尝试将 'UIAlertView'
更改为 'UIAlertController'
仍然收到不同的错误。
解决方法
您可以在 xCode 构建中使用以下 UIAlertController
替换:
UIAlertController *alert = [UIAlertController
alertControllerWithTitle:@"Error" message:@"Camera not available"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"Ok" style: style:UIAlertActionStyleDefault handler:nil];
[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。