gpt4 book ai didi

swift - __NSCFString nsli_lowerAttribute :intoExpression:withCoefficient:forConstraint: this occur in ios 10 only

转载 作者:搜寻专家 更新时间:2023-11-01 06:50:51 26 4
gpt4 key购买 nike

我制作了一个在 ios 11 中运行良好的应用程序,但是当我尝试在 ios 10 中运行它时。它突然开始崩溃并出现此错误。

-[__NSCFType nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:]: unrecognized selector sent to instance 0x600000199cc0

我尝试解决问题,但不知道为什么会这样。在异常断点中,它显示在下面的位置

 func showFullScreenLoading(inView objView:UIView?,withMsg strMsg:String = "Please wait!!!")
{
guard let view = objView else
{
return
}

let objParentView = UIView.init()
objParentView.translatesAutoresizingMaskIntoConstraints = false
objParentView.backgroundColor = UIColor.white.withAlphaComponent(0.2)
objParentView.tag = -123456
view.addSubview(objParentView)

view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[objParentView]|", options: [], metrics: nil, views: ["objParentView":objParentView])) //At this line exception error
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[objParentView]|", options: [], metrics: nil, views: ["objParentView":objParentView]))
}

Calling of the function

 func apiCalled(_ objOperation:TagApiOperation){

self.currentRequest = objHomeViewModel.apiCallHome(objOperation: objOperation, withDictData: [:], withLoaderBlock: { (isStart) in
if isStart{
SINGLETON.showFullScreenLoading(inView: self.view) // I called this function in view did load and there will be no background thread are there
}else{
SINGLETON.hideFullScreenLoading(inView: self.view)
}
}) { (isStatus, strMsg, arrBanner) in

}
}

最佳答案

最后我得到了这个问题的解决方案,因为安全区域。 iOS 11 提供安全区域,因此如果您有支持 iOS 10 的应用程序,请禁用安全区域。

关于swift - __NSCFString nsli_lowerAttribute :intoExpression:withCoefficient:forConstraint: this occur in ios 10 only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57303644/

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