1

I just reinstalled my mac and Xcode. Then [NSBundle mainBundle] always returns nil for some reason I don't know.

Thank you very much!

Here is the screenshot of my debug pane:

enter image description here

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119

1 Answers1

4

You have built your code in release mode. In release mode the debugger is unreliable. Variables can be optimized away. Switch to debug mode and try again.

Duncan C
  • 128,072
  • 22
  • 173
  • 272
  • So nice a day meeting you:) – birdenglish Mar 09 '16 at 01:08
  • @DuncanC out of curiosity, how did you know it's in release mode from that screenshot? – Cai Mar 09 '16 at 01:45
  • 1
    @Zhi-WeiCai, if you look in the lower right of the window it says "xxx was compiled with optimization - stepping may behave oddly; variables may not be available." That last part is the most important point. – Duncan C Mar 09 '16 at 02:54