Autolayout Breakpoints
Autolayout Breakpoints
Auto layout has become a crucial tool for iOS and OS X development. It makes creating layout for multiple screen sizes easy peasy. But sometimes it can drive you crazy, with verbose and misleading logs.
1 |
|
That’s a huge log! And I cut off the NSLayoutConstraint part. Yet, the second last line is giving a clue in which direction to go to fix this issue. Symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints.
All right, here’s what Xcode want’s you to do:

Honestly, that won’t help much, because basically it’ll just stop the execution and leave you up with LLDB, alone in the dark.
But there’s a little trick you can do to enhance the preceding symbolic breakpoint. Adding po [[UIWindow keyWindow] _autolayoutTrace] to it (for Obj-C projects) or expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace] (for Swift projects).

Now, on console, you’ll see all the UIView hierarchy and exactly where it has ambiguity.
1 |
|
Note that as you hit continue it’ll stop at every ambiguous layout you may have. And if that’s not enough for you to find out your autolayout issue, try changing the view’s color, who knows?
1 |
|
Fear no more young Padawan, make symbolic breakpoints and LLDB work for you!
I would like to thank Porter Hoskins for pointing out the correct LLDB command for Swift.
Autolayout Breakpoints的更多相关文章
- 使用Autolayout实现UITableView的Cell动态布局和高度动态改变
本文翻译自:stackoverflow 有人在stackoverflow上问了一个问题: 1 如何在UITableViewCell中使用Autolayout来实现Cell的内容和子视图自动计算行高,并 ...
- Masonry介绍与使用实践:快速上手Autolayout
1 MagicNumber -> autoresizingMask -> autolayout 以上是纯手写代码所经历的关于页面布局的三个时期 在iphone1-iphone3gs时代 w ...
- 利用代码添加autolayout约束
1.概述 通常我们通过storyboard能够完成的,代码也能够完成,所以这里介绍下代码实现约束的添加,通常我们不这么干(在不使用第三方框架的情况下,使用系统自带的类添加约束特别繁琐),所以这里仅仅简 ...
- 【原】iOS学习之苹果原生代码实现Autolayout和VFL语言
1.添加约束的规则 在创建约束之后,需要将其添加到作用的view上 在添加时要注意目标view需要遵循以下规则: 1)对于 两个同层级view之间 的约束关系,添加到它们的父view上 2)对于 两个 ...
- iOS学习笔记——AutoLayout的约束
iOS学习笔记——AutoLayout约束 之前在开发iOS app时一直以为苹果的布局是绝对布局,在IB中拖拉控件运行或者直接使用代码去调整控件都会发上一些不尽人意的结果,后来发现iOS在引入了Au ...
- iOS AutoLayout的用法
添加约束 代码实现Autolayout的步骤 利用NSLayoutConstraint类创建具体的约束对象 添加约束对象到相应的view上 - (void)addConstraint:(NSLayou ...
- AutoLayout(自动布局)
1. iOS两种自适应布局方式:(修正说明:) -AutoLayout(自动布局) + SizeClasses(尺寸类别) -Autoresizing (自动调整尺寸/弹簧式调整尺寸) 前者 Auto ...
- iOS-自动布局Autolayout(原创)
前言 基础知识 在一定情况下我们需要用到自动布局(autolayout) 这样我们就能使视图与视图之间的位置相互关联起来 横向:距离父视图左侧100 视图本身的宽度最小是100 距离父视图右侧是100 ...
- iOS - XIB之AutoLayout添加约束
XIB--AutoLayout添加约束 仿QQ登录界面: 说明:以下各图背景红色只是方便看清楚: 1.创建工程:创建xib文件 2.打开xib文件: (1).创建头像: 拖控件:uiimageview ...
随机推荐
- 转入墙内:SAS HBA crossflashing or flashing to IT mode, Dell Perc H200 and H310
Default firmware for this guide is:2118it.binVersion 20.00.07.00Release date: 11-FEB-16 所有资源已转到百度盘: ...
- Goroutine通信与thread in java间的通信
// This file contains the implementation of Go channels. // Invariants: // At least one of c.sendq ...
- oralce 常用sql
查看表空间及其数据文件 SELECT * FROM dba_data_files; 查看用户下的表SELECT * FROM user_tables; 查看用户表的注释SELECT * FROM us ...
- AJAX的简单解释
什么是AJAX AJAX = 异步 JavaScript 和 XML. AJAX 是一种用于创建快速动态网页的技术. 通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着可以 ...
- mycat环境搭建
最近工作中突然让搞mycat,特意私下在家先搞一套练个手: 1.先下载一个CentOS7 mini版本就可以(本人机器性能有限): 2.使用VMware创建虚拟机,过程百度下一大堆,这里不做详细介绍. ...
- lldb调试mysql 插件命令
# attach process llvm process attach --pid 64924 # 添加断点 breakpoint set -n dispatch_command(enum_ ...
- sface
单步检测方法分为两类:anchor-based如ssd.RetinaNet;2)Anchor-free 如DenseBox.UnitBox;anchor-based处理的尺度范围虽小,更精准:anch ...
- hdu1098
Ignatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. ...
- with的上下文管理
1.with with语句是在Python2.6中出现的新语句.在Python2.6以前要正确的处理涉及到异常的资源管理时,需要使用try/finally代码结构.如要实现文件在操作出现异常时也能正确 ...
- 如何推进企业流程体系建设?_K2 BPM
推进全集团统一的流程体系为什么比想象的难? 很多企业在推进全集团的流程管理过程中,经常会有一种“望山跑死马”的感觉.“各成员公司都建立起与集团公司统一的流程管理体系”,看似很简单一件事情,但没有经过良 ...