"Extra Chapter 2" Swift "Black Magic" dynamically obtains the value of the hidden attribute of a class instance

Insert image description here

Overview

When debugging Swift code, we are often amazed at the omnipotence of the debugger: the debugger can also clearly detect the contents of most "black box" class instances.

Insert image description here

Want to be able to easily find the value of a "private" property of a Thread instance (such as seqNum) yourself at runtime?

Little talk

Guess you like

Origin blog.csdn.net/mydo/article/details/134933626