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

How to print UIView.transform on live lldb console

尝试过: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))

可以工作。

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

这将打印发送者的原始数据(UIPinchGestureRecognizer)

p (CGAffineTransform) [sender.view transform]

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

您可以将 -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>>>