【问题标题】:App crashes RGBA in iOS 11 working fine in iOS10 and below应用程序在 iOS 11 中崩溃 RGBA 在 iOS10 及更低版本中运行良好
【发布时间】: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


【解决方案1】:

这不是因为图像选择器等等。

这只是因为 UITabbar 我为 Tabbar 分配了背景图像。我刚刚删除它现在可以正常工作了。

【讨论】:

    猜你喜欢
    • 2017-03-31
    • 2020-02-24
    • 1970-01-01
    • 1970-01-01
    • 2014-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多