TIP - Check ambiguous layout in Xcode debugger
How can I check auto layout issue of iOS application from Xcode? Easy.
- Run your application
- Pause by debugger
- Type the following command from debug console:
You can see the trace from debug console such as:
*<UIWindow:0x9980df0>
| *<UIView:0x8eb2fd0>
| | *<UISwitch:0x8eb31b0>
| | | <_UISwitchInternalViewNeueStyle1:0x8eb3540>
| | | | <UIView:0x8eb3ac0>
| | | | | <UIView:0x8eb3840>
| | | | <UIView:0x8eb3a10>
| | | | | <UIView:0x8eb38f0>
| | | | <UIImageView:0x8eb3da0>
| | *<UISlider:0x8eb61d0> - AMBIGUOUS LAYOUT
| | | <UIView:0x8eb9290>
| | | | <UIView:0x8eb9af0>
| | | | | <UIView:0x8eb9bc0>
| | | | <UIView:0x8eba490>
| | | <UIImageView:0x8eba6a0>
| | | | <UIImageView:0x8eba540>
If you think type this long command is too tedious, please try to use alias. Check about my blog article for LLDB usage.
Please see the following WWDC 2012 sessions to understand more about auto layout.
댓글
댓글 쓰기