【发布时间】:2018-02-22 09:15:12
【问题描述】:
当我打开图像选择器并选择图库时,该应用在 iOS 11 中崩溃,但在 iOS 10 及更低版本中运行良好
018-02-22 14:42:53.630334+0530[589:98531] * -[UICGColor encodeWithCoder:] 中的断言失败, 2018-02-22 14:42:53.631850+0530[589:98531] * 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“在这种情况下仅支持 RGBA 或白色空间。” p>
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:@"Choose From" preferredStyle:UIAlertControllerStyleActionSheet];
[actionSheet addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
// Cancel button tappped.
[self dismissViewControllerAnimated:YES completion:^{
}];
}]];
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Gallery" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
UIImagePickerController *imgpicker = [[UIImagePickerController alloc] init];
imgpicker.allowsEditing = YES;
imgpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgpicker.delegate=(id)self;
[self presentViewController:imgpicker animated:YES completion:nil];
}]];
【问题讨论】:
-
这很难说,因为您没有提供任何代码或堆栈跟踪,但我认为您为某些 API 提供了无效的颜色空间。
-
但它在 iOS 11 下工作我不知道为什么会这样?
-
Apple 可能在 iOS 11 中加强了一些内部验证检查。
-
我已将所有内容添加到 info.plist
标签: objective-c ios10 ios11