Asyncdisplaykit: A problem of ASImageNode on iOS 8.1.x

Created on 21 Mar 2017  Â·  7Comments  Â·  Source: facebookarchive/AsyncDisplayKit

Hello, sometimes, We use this method crash on iOS 8.1.x, our project AsyncDisplayKit version is 2.0.2, We think that is a problem of ASImageNode and other iOS system is perfect, can you check this problem?

- (void)addBottomToolBarNode{

    ASImageNode *imageNode = [SJUIKit nodeImageNodeAddNode:self ClipsToBounds:NO ContentMode:UIViewContentModeScaleToFill];
    [imageNode setImage:[UIImage imageNamed:@"home_main_cell_bottom_bg.png"]];
    _bottomToolBarNode = imageNode;

}

+ (ASImageNode *)nodeImageNodeAddNode:(ASDisplayNode *)addNode ClipsToBounds:(BOOL)clipsToBounds ContentMode:(UIViewContentMode)contentMode{

    ASImageNode *imageNode = [ASImageNode new];
    imageNode.clipsToBounds = clipsToBounds;
    imageNode.contentMode = contentMode;
    [addNode addSubnode:imageNode];
    return imageNode;

}
Close if no Reply

Most helpful comment

@Luis-X Taking the adoption of versions below iOS 9 into account, I do nothing about the crash. Of course, you can put the related code in -didLoad which runs on main thread or use imageWithContentsOfFile: instead of -imageNamed.

All 7 comments

@Luis-X Hey, can you please post a crash log in here? Thanks!

f85a5a35-38ad-4ab9-8d68-f1b86004efa6
4d7a9d2b-63ec-466e-928a-bf715ad995f1

[UIImage imageNamed:] is not thread safe before iOS 9.

How can i fix it?

@Luis-X Taking the adoption of versions below iOS 9 into account, I do nothing about the crash. Of course, you can put the related code in -didLoad which runs on main thread or use imageWithContentsOfFile: instead of -imageNamed.

OK, Thank you very much! O(∩_∩)O~

Hey @Luis-X, @zjmdp, it seems like this issue is fixed. I will close this for now. Thanks all!

Was this page helpful?
0 / 5 - 0 ratings