When debugging Objective-C code in LLDB, I often create variables that refer to objects in memory using just their address. For example:
(lldb) po self.view
<UIView: 0x7ff5f7a18430; frame = (0 64; 320 504); autoresize = W+H; layer = <CALayer: 0x7ff5f7a192e0>>
(lldb) e CALayer* $layer = (CALayer*) 0x7ff5f7a192e0
(lldb) e $layer.borderWidth
(CGFloat) $17 = 0
Given just an object's type and its address in memory, I'm able to inspect and manipulate it.
Is this impossible when debugging Swift code?
(lldb) e let $layer = unsafeBitCast(0x7fd120f474b0, CALayer.self)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With