ios - EXC_BAD_ACCESS KERN_INVALID_ADDRESS ios < 9.3 xcode 10

标签 ios iphone ios9 xcode10

<分区>

使用最新的 xcode 我只在 ios 9.0>9.2.x 上崩溃

#0. Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x227dbae6 objc_msgSend + 5
1  CoreUI                         0x2700b023 -[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:] + 646
2  CoreUI                         0x2700ad99 -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:withBaseKeySelector:] + 284
3  CoreUI                         0x2700a52b -[CUICatalog namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 94
4  UIKit                          0x279aba2d __98-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 496
5  UIKit                          0x279ab77f -[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 230
6  UIKit                          0x279abf51 -[_UIAssetManager imageNamed:withTrait:] + 408
7  UIKit                          0x2747694d +[UIImage imageNamed:inBundle:compatibleWithTraitCollection:] + 172    
8  UIKit                          0x272d6537 +[UIImage imageNamed:] + 110
9  SuperGuidaTV                   0x140ffd -[FixedBackgroundNavigationController viewDidLoad] (FixedBackgroundNavigationController.m:375)
10 SuperGuidaTV                   0x126dfd -[ISNavigationController viewDidLoad] (ISNavigationController.m:522)
11 UIKit                          0x274fd075 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 60
12 UIKit                          0x27199d79 -[UIViewController loadViewIfRequired] + 1028
13 UIKit                          0x27199959 -[UIViewController view] + 24

崩溃发生在这段代码中:(在 viewDidLoad 内部)

[super setDelegate:self];
[super viewDidLoad];
[self backgroundImageView];

if (!_backgroundImage)
    [self setBackgroundImage:[UIImage imageNamed:@"BkImage"]];

[self backgroundImageView] 只是初始化一个 UIImageViewself.viewsetBackgroundImage 框架> 只需设置从 XCAsset 文件夹中获取的图像。

-(UIImageView *)backgroundImageView {
    if (!_backgroundImageView)
    {
        _backgroundImageView = [[UIImageView alloc] initWithImage:self.backgroundImage];
        [self.view insertSubview:_backgroundImageView atIndex:0];
        [_backgroundImageView setFrame:self.view.bounds];
        [_backgroundImageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
    }
    return _backgroundImageView;
}

-(void)setBackgroundImage:(UIImage *)backgroundImage {
    _backgroundImage = backgroundImage;
    if (self.forceNoBackground)
    {
        [self.backgroundImageView setHidden:YES];
        return;
    }
    else if (_backgroundImageView) [self.backgroundImageView setImage:backgroundImage];
}

正如您从日志中看到的,崩溃是在设置 uiimage 后立即发生的。

我只在 ios 9 上遇到其他崩溃,总是因为访问错误。

目标设置为部署目标为9.0,但项目设置为8.3 Project deployment target

会不会是这个原因? 我应该将图像移出 XCasset 文件夹吗?

非常感谢。

最佳答案

感谢所有回答我的问题的人: 如评论中所述,问题与以下问题相同:our app crashed in iOS 9 which upload by Xcode 10

并在 xcode 10.1 beta2 中解决

解决了影响应用程序与 iOS 9.0、9.1 和 9.2 兼容性的问题。包含使用 Xcode 10 构建的 Assets 目录且部署目标设置为 iOS 9.0、9.1 或 9.2 的应用程序将生成与这些 iOS 版本的运行时不兼容的内容。使用 Xcode 10.1 重建应用程序可解决此问题。 (44535967)

这个问题让我的应用程序崩溃了太多...

非常感谢

关于ios - EXC_BAD_ACCESS KERN_INVALID_ADDRESS ios < 9.3 xcode 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52643074/

上一篇:ios - Native Code Capture Image 在 IOS 11 上抛出异常?

下一篇:ios - ARKit – 如何为大环境生成世界地图?

相关文章:

iphone - 通过 for 循环使用键将数据添加到 NSMUtableArray

ios - 如何从一个 Storyboard切换到另一个 Storyboard

ios - 在 info.plist (Xcode) 中为不同的构建使用相同的包标识符

iOS 9 : Warning "All interface orientations must be supported unless the app requires full screen" for universal app

ios - 使用 ARKit 将屏幕坐标映射到面部网格的纹理坐标

ios - 使用 KIF 点击状态栏或以编程方式进行

ios - ABAddressBook API 在大量使用该应用程序后停止工作?

ios - 如何继续下一个viewController

ios - 在 iOS/Swift 中从 gs_instruments 播放单个 midi 音符

ios - 如何删除新 iTunes Connect 站点中的应用程序构建?