我正在开发一个 IOS 应用程序。我使用 Facebook AsyncDisplayKit 库。我想在 ASNodeCell 中添加一个按钮 我得到“变量‘节点’在被块捕获时未初始化。如何在 ASNodeCell 中添加 UIButton 或 UIWebView 控件。请帮助我
dispatch_queue_t _backgroundContentFetchingQueue;
_backgroundContentFetchingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
dispatch_async(_backgroundContentFetchingQueue, ^{
ASDisplayNode *node = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button sizeToFit];
node.frame = button.frame;
return button;
}];
// Use `node` as you normally would...
node.backgroundColor = [UIColor redColor];
[self.view addSubview:node.view];
});