gpt4 book ai didi

ios - 线程 1 : signal SIGBART on AppDelegate class

转载 作者:行者123 更新时间:2023-11-30 12:59:07 25 4
gpt4 key购买 nike

我最近更新 iOS 后开始收到此错误。我认为这与我的约束的格式有关,但我无法弄清楚。这是我的错误消息

由于未捕获的异常“NSInvalidLayoutConstraintException”而终止应用程序,原因:“约束不正确地关联不兼容类型的 anchor :”

这是我的一些约束代码

// Bottom constraint: description
addConstraint(NSLayoutConstraint (item: descriptionTextView, attribute: .bottom, relatedBy: .equal, toItem: itemImageView, attribute: .bottom, multiplier: 1, constant: 0))

//right constraint: description
addConstraint(NSLayoutConstraint(item: descriptionTextView, attribute: .right, relatedBy: .equal, toItem: itemImageView, attribute: .bottom, multiplier: 1, constant: 160))

//left constraint: description
addConstraint(NSLayoutConstraint(item: descriptionTextView, attribute: .left, relatedBy: .equal , toItem: itemImageView, attribute: .right, multiplier: 1, constant: 8))

//height constraint: description
addConstraint(NSLayoutConstraint(item: descriptionTextView, attribute: .height, relatedBy: .equal, toItem: self, attribute: .height, multiplier: 0, constant: 100))

如何解决线程 1:信号 SIGBART 崩溃问题?

最佳答案

在最后一个 addConstraint : toItem: self -> self.view

addConstraint( NSLayoutConstraint(item: descriptionTextView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal , toItem: self.view, attribute: NSLayoutAttribute.height, multiplier: 0, constant: 100))

关于ios - 线程 1 : signal SIGBART on AppDelegate class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40049517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com