我正在使用 FacebookAsyncDisplayKit
创建一个CollectionView
这样CollectionView
的,ASCollectionView
我正在尝试添加UIKit's
UIImageView
到单元格中。我得到以下崩溃:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: ''
*** First throw call stack:
(
0 CoreFoundation 0x00bf2946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x0087ba97 objc_exception_throw + 44
2 CoreFoundation 0x00bf27da +[NSException raise:format:arguments:] + 138
3 Foundation 0x004ef810 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
4 Sample 0x000b21df -[ASDisplayNode view] + 607
5 Sample 0x0007a0f5 -[PlainImageNode initWithCellOfSize:] + 533
6 Sample 0x0007e34d -[ASVC_UIImage_ViewController collectionView:nodeForItemAtIndexPath:] + 269
7 Sample 0x00085c36 -[ASCollectionView dataController:nodeAtIndexPath:] + 150
libc++abi.dylib: terminating with uncaught exception of type NSException
在崩溃的代码之后,这是ASCellNode
我为我的ASCollectionView
. 我正在尝试UIImageView
添加ASCellNode
:
- (instancetype)initWithCellOfSize:(CGSize)size
{
if (!(self = [super init]))
return nil;
_kittenSize = size;
// kitten image, with a solid background colour serving as placeholder
_imageView = [[UIImageView alloc] init];
_imageView.image = [UIImage imageNamed:@"testImage.jpg"];
_imageView.frame = CGRectMake(10.0f, 10.0f, 40.0f, 40.0f);
[self.view addSubview:_imageView];
[self setBackgroundColor:[UIColor yellowColor]];
return self;
}
恐怕我可以将UIKit
组件添加到ASCollectionView's
ASCellNode
. 我们不能在层次结构中添加UIKit
组件是真的吗?ASCellNode's