AutoLayout bug集合

'NSInternalInconsistencyException', reason: '<NSISEngine: 0x16d5ef10>...

http://stackoverflow.com/questions/28111635/ios-aspect-ratio-constraint-breaks-on-ios7-works-on-ios8

这好像是ios7.1的bug,对浮点数计算有误,一般添加按钮比例约束的时候multiplier值都是这种格式6:10 ,这样可能系统会精确的计算小数点吧.写成0.7就好了.

    • 崩溃信息:
      'Unable to create description in descriptionForLayoutAttribute_layoutItem_coefficient. Something is nil'
    • 原因
      因为偷懒使用了reset to suggested constraints, autolayout 帮我自动加了baseline的constraints,而baseline只有iOS8以后才有,兼容iOS7就崩溃了,直接移除baseline相关的constraint即可。
    • 参考链接
      http://stackoverflow.com/questions/26024906/unable-to-create-description-in-descriptionforlayoutattribute-layoutitem-coeffi/26045383#2604538
    • 按照老外的方法,把所有可能会出现bug的xib拖到文本编辑器sublime text2中,在条件表达式中加入.*"baseline".*  把高亮的全部删掉,回到xib重做
    • 可能还不行,是因为调试缓存xib的问题,把程序卸载了,command + k ,command + r 重新运行一次
原文地址:https://www.cnblogs.com/congliang/p/4769407.html