Xcode debugger doesn't print objects and shows nil, when they aren't

后端 未结 15 1722
暖寄归人
暖寄归人 2020-12-02 05:09

Xcode shows an error when trying to print an object with po , but only for one project.

error: Couldn\'t mater

相关标签:
15条回答
  • 2020-12-02 06:00

    There are other ways this can occur. For me it was because the "Other C Flags" value was set to "-O2", even for the debug build. Turning this off for the debug build resolved the issue.

    0 讨论(0)
  • 2020-12-02 06:03

    I have run into this as well and when I found I was in release mode I switch to debug ... no fix. Turns out that I had to do a clean first (cmd+shift+k).

    So I think what happens is that after built in release mode not everything is recompiled in develop and so lldb can't properly read the symbols. After cleaning and recompiling in develop it worked for me.

    0 讨论(0)
  • 2020-12-02 06:06

    Go to "Other C Flags" in build setting and set debug value from -o2 to -O0

    0 讨论(0)
提交回复
热议问题