iosnsbundlemainbundle

NSBundle.mainBundle() returns nil


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


Solution

  • 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.