Masonry 约束冲突,怎么能够快速定位到问题控件,太难找了!!更诡异的是,我把相关的控件都注释掉了,这个约束冲突还存在,太诡异了!!!
    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. 
(
    "<MASLayoutConstraint:0x7ff43e265c10 UILabel:0x7ff43e2673a0.top == SGStoreDetailInfoView:0x7ff43e267080.top + 14>",
    "<MASLayoutConstraint:0x7ff43e27ab50 UILabel:0x7ff43e2673a0.top == SGStoreDetailInfoView:0x7ff43e267080.top + 10>"
)
                            
                                    Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这个说明已经很清楚了,有两个 top 约束,一个要 10 ,一个要 14
可以通过添加全局断点的方式,来查找出现问题的视图。
通过
command+7切换到项目的断点列表页面,并通过底部的加号按钮添加全部断点。运行程序,当程序检测到约束问题时,会停在发生问题的代码位置。
通过command+6切换到项目的Debug界面(显示栈调用视图)界面。