如何在live lldb控制台上打印UIView.transform

时间:2015-05-13 09:09:39

标签: ios objective-c core-graphics

尝试:po (CGAffineTransform)[pinch.view transform]

但是说

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x20). The process has been returned to the state before expression evaluation.

然而

(lldb) po (CGRect)[pinch.view frame] (origin = (x = 16, y = 96), size = (width = 343, height = 500)) (origin = (x = 16, y = 96), size = (width = 343, height = 500))

可以工作。

3 个答案:

答案 0 :(得分:3)

这将打印发件人的原始数据(UIPinchGestureRecognizer)

p (CGAffineTransform) [sender.view transform]

只需将视图替换为您的视图

enter image description here

答案 1 :(得分:0)

使用NSLog(@"%@",NSStringFromCGAffineTransform(self.view.transform));

答案 2 :(得分:0)

您可以将-bounds发送到您的UIView实例:

po [0x11d925730 bounds]
<CALayer:0x2811e64e0; position = CGPoint (187.5 420.5); bounds = CGRect (0 0; 375 589); delegate = <UIView: 0x11d925730; frame = (0 126; 375 589); layer = <CALayer: 0x2811e64e0>>; opaque = YES; allowsGroupOpacity = YES; transform = CATransform3D (1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1); frame = (0 126; 375 589); layer = <CALayer: 0x2811e64e0>>>