【发布时间】:2018-11-25 12:16:40
【问题描述】:
使用我的调试器 (lldb),当它是 Objective-C 代码时,我可以轻松地创建实例类。
(lldb) e id $my_hello = [hello_from_objc new]
(lldb) po $my_hello
<hello_from_objc: 0x1c4013020>
(lldb) po [$my_hello secret_objc_method]
0x000000000000002a
(lldb) po (int) [$my_hello secret_objc_method]
42
但是当代码是纯 Swift 时,我不知道如何对 lldb 的表达式命令执行相同的操作。我很容易在 Swift 代码中创建一个实例..
let my_swift_framework = Hello_Class()
print("✔️ \(my_swift_framework.samplePublicVariable)")
【问题讨论】:
标签: objective-c swift lldb