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

后端 未结 15 1720
暖寄归人
暖寄归人 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 05:41

    I ran on this problem when some dependency was added in a very specific way - it works but when you try to print something from this framework you get error

    Solution was to add this dependency in a general way

    0 讨论(0)
  • 2020-12-02 05:42

    I just encountered this issue and found that it was because Deployment Postprocessing = YES in the Build Settings.

    Changing this to NO fixed it, as seen in the screenshot below:

    enter image description here

    Xcode version: 6.0.1 (6A317) on OSX 10.9.5

    0 讨论(0)
  • 2020-12-02 05:45

    The reality is that the system should work out of the box and doesn't due to links to a multiple quantity of different settings, to a point that things may work for you, or not.

    Why doesn't the system allows always to debug when in debug mode is a mystery that only Apple can answer (if they cared, which latelly i doubt they do).

    After all, the difference between debug / non-debug would be extra tables with metadata which only fill in memory / disk space.

    If you are compiling against the simulator or a device directly, you will not care of those extra megabytes.

    So we need to run extra loops to just do a very basic and plain thing that all ides that i know since last century do just fine.

    And to add, for me what worked was changing on "Debug" the Link-Time Optimization from "Monolithic" to "No" (xcode 8).

    0 讨论(0)
  • 2020-12-02 05:47

    Make sure Link-Time Optimization = No for debug mode in Build Settings.

    0 讨论(0)
  • 2020-12-02 05:48

    Are you sure you are not in "Release mode"?

    If you want to see variable values you have to be in "Debug mode" (click on your project name on the top left corner near start/stop buttons, then "Edit scheme...", then "Run" settings, then "Info" tab, then "Build Configuration". Here set "Debug". If it was on "Release" that's the matter you saw all nils).

    0 讨论(0)
  • 2020-12-02 05:53

    I've set "Optimization Level" for Debug configuration to "None" and it solved problem.

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