Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need help about ASCornerRoundingTypeClipping #910

Closed
LisonFan opened this issue May 6, 2018 · 3 comments
Closed

I need help about ASCornerRoundingTypeClipping #910

LisonFan opened this issue May 6, 2018 · 3 comments
Assignees

Comments

@LisonFan
Copy link

LisonFan commented May 6, 2018

I use ASCornerRoundingTypeClipping mode, but app crash
My code

self.newsImageNode = [[ASNetworkImageNode alloc] init];
self.newsImageNode.URL = [NSURL URLWithString:self.model.pic];
self.newsImageNode.placeholderFadeDuration = 0.2;
self.newsImageNode.placeholderEnabled = YES;
self.newsImageNode.cornerRoundingType = ASCornerRoundingTypeClipping;
self.newsImageNode.backgroundColor = [UIColor whiteColor];
self.newsImageNode.cornerRadius = 10.f;
[self addSubnode:self.newsImageNode];

Crash log

2018-05-06 22:05:35.306897+0800 Texture_Learning_1[73306:8769316] [Node] View controller <NewsViewController: 0x7fd15c10a520> will appear
2018-05-06 22:05:35.307878+0800 Texture_Learning_1[73306:8769316] [Collection] performBatchUpdates <ASTableNode: 0x7fd15c3060f0> {  }
2018-05-06 22:05:35.308007+0800 Texture_Learning_1[73306:8769316] [Collection] <ASTableView: 0x7fd15d819a00> Skipped update because load hasn't happened.
2018-05-06 22:05:35.308797+0800 Texture_Learning_1[73306:8769316] [Collection] Initial reloadData <ASTableNode: 0x7fd15c3060f0>
2018-05-06 22:05:35.309158+0800 Texture_Learning_1[73306:8769316] [Collection] New content: { itemCounts = [ <S0: 11> ] }
2018-05-06 22:05:35.325826+0800 Texture_Learning_1[73306:8769316] [Node] Propagating new traits for <NewsViewController: 0x7fd15c10a520>: { userInterfaceIdiom = Phone; containerSize = {414, 736}; horizontalSizeClass = Compact; verticalSizeClass = Regular; forceTouchCapability = Available }
2018-05-06 22:05:35.325995+0800 Texture_Learning_1[73306:8769316] [Node] Propagating new traits for <NewsViewController: 0x7fd15c10a520>: { userInterfaceIdiom = Phone; containerSize = {414, 736}; horizontalSizeClass = Compact; verticalSizeClass = Regular; forceTouchCapability = Available }
2018-05-06 22:05:35.329234+0800 Texture_Learning_1[73306:8769316] *** Assertion failure in -[ASNetworkImageNode actionForLayer:forKey:], /Users/lisonfan/Developer/个人/iOS/Texture_Learning_1/Pods/Texture/Source/ASDisplayNode.mm:1764
2018-05-06 22:05:35.342618+0800 Texture_Learning_1[73306:8769316] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'We shouldn't get called back here unless we are layer-backed.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001098971e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x0000000108f2c031 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010989c472 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00000001089cf652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
	4   AsyncDisplayKit                     0x00000001083e0779 -[ASDisplayNode actionForLayer:forKey:] + 473
	5   QuartzCore                          0x000000010d90210e -[CALayer actionForKey:] + 105
	6   QuartzCore                          0x000000010d907c0d _ZN2CA5Layer12begin_changeEPNS_11TransactionEjP11objc_objectRS4_ + 169
	7   QuartzCore                          0x000000010d9013dc -[CALayer setContents:] + 97
	8   AsyncDisplayKit                     0x00000001083de067 __74-[ASDisplayNode _updateClipCornerLayerContentsWithRadius:backgroundColor:]_block_invoke + 1127
	9   AsyncDisplayKit                     0x0000000108420f4a ASPerformBlockOnMainThread + 90
	10  AsyncDisplayKit                     0x00000001083ddb71 -[ASDisplayNode _updateClipCornerLayerContentsWithRadius:backgroundColor:] + 161
	11  AsyncDisplayKit                     0x00000001083de89b __45-[ASDisplayNode _setClipCornerLayersVisible:]_block_invoke + 747
	12  AsyncDisplayKit                     0x0000000108420f4a ASPerformBlockOnMainThread + 90
	13  AsyncDisplayKit                     0x00000001083de56c -[ASDisplayNode _setClipCornerLayersVisible:] + 124
	14  AsyncDisplayKit                     0x00000001083dedbc __59-[ASDisplayNode updateCornerRoundingWithType:cornerRadius:]_block_invoke + 652
	15  libdispatch.dylib                   0x000000010daa5807 _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x000000010daa6848 _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x000000010dab192b _dispatch_main_queue_callback_4CF + 628
	18  CoreFoundation                      0x0000000109859c99 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	19  CoreFoundation                      0x000000010981dea6 __CFRunLoopRun + 2342
	20  CoreFoundation                      0x000000010981d30b CFRunLoopRunSpecific + 635
	21  GraphicsServices                    0x00000001126f2a73 GSEventRunModal + 62
	22  UIKit                               0x000000010a4290b7 UIApplicationMain + 159
	23  Texture_Learning_1                  0x0000000107ff57af main + 111
	24  libdyld.dylib                       0x000000010d721955 start + 1
	25  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@Flatout73
Copy link
Contributor

Flatout73 commented May 23, 2018

Try to add self.newsImageNode.isLayerBacked = true (swift)

@LisonFan
Copy link
Author

@Flatout73 No setter method 'setIsLayerBacked:' for assignment to property

@yxztj
Copy link
Contributor

yxztj commented Jul 11, 2018

Same issue here.
We have a corner rounded node(wrapping a video player node and some controls in it), so isLayerBacked is not applicable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants