Texture icon indicating copy to clipboard operation
Texture copied to clipboard

ASNetworkImageNode image disappears when "displaysAsynchronously = false" and reloadData()

Open ArmandsB opened this issue 8 years ago • 5 comments

Hello. I found a bug, when I wanted to "displaysAsynchronously = false" my ASNetworkImageNode. At first time image shows correctly, but after reloadData is called, it disappears.

To reproduce this bug (in ASDKGram example):

  1. PhotoCellNode need to add “_userAvatarImageNode.displaysAsynchronously = false;”
  2. ASDK PhotoFeedNodeController - in loadView method I just added
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [self.tableNode reloadData];
  })

ArmandsB avatar Jul 05 '17 12:07 ArmandsB

It seems that setNeedsDisplay is not working as expected when image get from cache, if we call setNeedsDisplay after e.g. 0.1 seconds, it will redraw image as expected.

hovox avatar Jul 11 '17 12:07 hovox

It seems calling [self.imageNode recursivelyEnsureDisplaySynchronously:YES]; in cell's didLoad method fixed the issue. @ArmandsB can you confirm that it fixed in your case? I know that calling [self.imageNode recursivelyEnsureDisplaySynchronously:YES]; is not the right solution, we may call this only when user makes pull-to-refresh.

hovox avatar Jul 11 '17 14:07 hovox

Sorry for long (very) wait, but using [self.imageNode recursivelyEnsureDisplaySynchronously:YES]; fixes this issue.

ArmandsB avatar Jul 31 '17 06:07 ArmandsB

In the newest versions, the image disappears when you scroll it off the viewport, then takes a few seconds to reappear

SolorzanoJose avatar Sep 18 '18 19:09 SolorzanoJose

I confirm this issue still happening

patryk-sredzinski avatar May 25 '23 10:05 patryk-sredzinski