Ios UIAlertController和UIViewAlertForUnsatifiableConstraints错误
昨天我升级到了Xcode 10.2,开始使用Swift 5,在弹出我的Ios UIAlertController和UIViewAlertForUnsatifiableConstraints错误,ios,swift,swift5,xcode10.2,Ios,Swift,Swift5,Xcode10.2,昨天我升级到了Xcode 10.2,开始使用Swift 5,在弹出我的UIAlertControllerphoto提示符时注意到了这个错误。我不记得在Xcode 10.1中见过它 Will attempt to recover by breaking constraint <NSLayoutConstraint:0x600001321e00 UIView:0x7fe1246070a0.width == - 16 (active)> Make a symbolic breakp
UIAlertController
photo提示符时注意到了这个错误。我不记得在Xcode 10.1中见过它
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001321e00 UIView:0x7fe1246070a0.width == - 16 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
我尝试在promptPhoto()
方法中使用此代码来设置UIAlertController
的宽度,但没有效果
let width:NSLayoutConstraint=NSLayoutConstraint(项目:prompt.view!,
属性:NSLayoutConstraint.attribute.width,
relatedBy:NSLayoutConstraint.Relation.equal,
toItem:无,
属性:NSLayoutConstraint.attribute.notanaAttribute,
乘数:1,
常量:self.view.frame.width)
prompt.view.addConstraint(宽度)
有没有办法控制UIAlertController
的宽度,以便我可以消除错误消息
提前谢谢。这可能是一个Xcode错误。苹果还没有修复。这个错误发生在最新的Xcode 11.3.1版本中,也发生在您的
构建设置->Swift编译器-语言中,使用Swift 5
或Swift 4.2
?@Nizzam Swift语言版本被设置为Swift 5,我想说不用担心,这似乎是UIAlertController中的内部布局不一致。这似乎是一个错误:是否仍然没有修复此问题?保持打印错误Xcode 12.2-相同