当我加载我的 View Controller 时,我收到此错误:
*** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fda42c66e30> is a part of cycle in its layer tree'
我不知道为什么。我想我可能添加了一个与图层混淆的第三方框架,但我在故障排除中将其删除。任何见解都会很棒。编辑
它发生在
viewDidLoad
我的 tableViewcontroller
.我的第二个 vc 上有一个 tableView。我已经将范围缩小到它在设置 heightForRowAtIndexPath
时崩溃在第 4 个自定义单元格上。单元格处于静态 tableView
................. :/越来越近!这是我的
heightForRowAtIndexPath
:override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
print("idx = \(indexPath.row)")
return super.tableView(tableView, heightForRowAtIndexPath: indexPath)
}
很一般。关于这可能导致的其他地方的任何想法?
最佳答案
这可能会帮助仍然有问题的人,
对我来说,问题是这样的
layer.addSublayer(layer)
给自己添加一层🤦♂️。在这个错误之后,我打算自杀:(。
关于calayer - 层是其层树 iOS 9 Swift 2 中循环的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31553111/