win7下使用lldb调试
Have you ever added an element in an UIView and after checking in the simulator you realized that it was not what you were expecting?
您是否曾经在UIView中添加过元素,并且在签入模拟器后就意识到它不是您所期望的?
Well, our beloved Xcode has a very useful feature for inspecting visual elements, which is called View Debugger. This feature can be activated while your app is running by clicking in the button indicated in the image below, located in the debugger bar.
好吧,我们钟爱的Xcode具有检查视觉元素的非常有用的功能,称为View Debugger。 单击应用程序运行时,可通过单击调试器栏中下图所示的按钮来激活此功能。
了解View Debugger (Getting to know the View Debugger)
After clicking on the View Debugger button, Xcode will pause the execution of your application and capture the state of your current window.
单击“查看调试器”按钮后,Xcode将暂停应用程序的执行并捕获当前窗口的状态。
A screen similar to the one below will appear for you. Let’s try to understand what Xcode is showing us.
将会出现类似于以下屏幕的画面。 让我们尝试了解Xcode向我们展示了什么。
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/011bc295f57ed6ccfc5ccf9fcdc4d3c6.png)
Exploded 3D rendering of app views: The title describes the function itself. This area will show an exploded 3D view of your current UIWindow, showing all the elements.
应用程序视图的爆炸性3D渲染:标题描述了函数本身。 该区域将显示当前UIWindow的分解3D视图,并显示所有元素。
View hierarchy: Shows a list of all views and its constraints in the current UIWindow hierarchy. Views that are created by the system will also appear in this hierarchy.
视图层次结构:显示当前UIWindow层次结构中所有视图及其约束的列表。 系统创建的视图也将出现在此层次结构中。
View controls: These controls will change the visualization of the current exploded view, it is possible to inspect the views in 360 degrees and also zoom in/out, show/hide views and constraints.
视图控件:这些控件将更改当前爆炸视图的可视化,可以360度检查视图,还可以放大/缩小,显示/隐藏视图和约束。
Inspector area: In this area, you can see pieces of information about a selected object in the exploded view or the view hierarchy. The Object tab shows basic information about the selected view, the Size tab shows information about the size of the view and its constraints. It is also possible to select constraints in the view hierarchy and the exploded view and check its information details.
检查器区域:在该区域中,您可以在分解视图或视图层次结构中查看有关所选对象的信息。 “对象”选项卡显示有关所选视图的基本信息,“大小”选项卡显示有关视图的大小及其约束的信息。 也可以在视图层次结构和分解视图中选择约束并检查其信息详细信息。
You can also get information from a view by clicking the right button in the view hierarchy or the exploded view. You will be able to print information in the console, emphasize constraints, hide views that are in the front, or behind the view you selected.
您还可以通过在视图层次结构或分解视图中单击右键来从视图中获取信息。 您将能够在控制台中打印信息,强调约束条件,隐藏所选视图的前面或后面的视图。
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/ef346f2d766eb21ff563a122e894b67c.png)
However, my favorite part of the view debugger is using it along with LLDB and the simulator. It is possible to inspect and change the properties of the elements in the current hierarchy without recompiling the project.
但是,我最喜欢的视图调试器部分是将它与LLDB和模拟器一起使用。 无需重新编译项目,就可以检查和更改当前层次结构中元素的属性。