Xcode 7.1.1,7.2在应用程序中使用openURL时注意到(电话)。将id添加到我关于此VC的所有约束中,没有一个显示为带有警告的约束。
func makeCall(theNumber: String) {
if theNumber != "" {
if let url = NSURL(string: "tel://" + theNumber) {
UIApplication.sharedApplication().openURL(url)
}
}
}
调试区域显示:
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x15ea3670 V:|-(20)-[UIInputSetContainerView:0x15e87f90] (Names: '|':UITextEffectsWindow:0x15df11f0 )>",
"<NSLayoutConstraint:0x15d986a0 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x15e87f90] (Names: '|':UITextEffectsWindow:0x15df11f0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15ea3670 V:|-(20)-[UIInputSetContainerView:0x15e87f90] (Names: '|':UITextEffectsWindow:0x15df11f0 )>
是,创建了一个没有添加视图/约束的空白单视图项目(如所述),使用命令+y切换模拟器,并收到相同的约束警告。
|-(20) -当状态栏中的调用可见时,[U[InputSetContainerView约束中断