Search code examples
iosxcodeswiftswift-playground

How to see Swift variable's address in debugger


I have just started learning swift language by Apple. However I have a doubt, I am not sure how can I see my variable/constant's address in the the debugger. When I use p or po in the debugger, I get the value stored in the variable/constant but I want to know the address of the variable/constant itself. It may be a very straight forward answer but I would really appreciate if someone could help me with this.


Solution

  • You can find the address by setting a breakpoint and opening up the variable in the debugger window.

    A random variable Screenshot of Address