使用openURL的约束冲突警告

时间:2015-11-24 20:20:18

标签: ios autolayout constraints xcode7

Xcode 7.1.1,7.2 在app(电话)中使用openURL时注意到。 添加了有关此VC的所有约束的ID,并且没有显示为具有警告的那些。

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 )>

1 个答案:

答案 0 :(得分:0)

是的,创建了一个空白的单一视图项目,没有添加视图/约束(如上所述),使用命令+ y切换模拟器,并收到相同的约束警告。

|-(20)-[UIInputSetContainerView constraint breaks when call-in status bar gets visible