Xcode 6 weird (null) display object in debugger

I see strange behavior with the Xcode 6 debugger. I created a generic singleton instance using the following code:

+ (instancetype)shared { static DataBaseManager *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[DataBaseManager alloc] init]; }); return sharedInstance; } 

Immediately after initializing the object, calling the method as follows:

 DataBaseManager *manager = [DataBaseManager shared]; NSLog(@""); 

I set a breakpoint in "NSLog" and I see the following debugger status:

Xcode 6 debugger screen capture

I made sure that I start in debug mode, and that the build settings are fine, following the following question: The Xcode debugger does not print objects and shows zero when they are not

Any ideas on why this is happening? This is the first time I have seen such strange behavior. Any help is appreciated.

 **UPDATE** A bug was reported to apple bug report system. The bug status is: Duplicate of 17164538 (Closed) so it is probably a known bug in Xcode. 
+6
source share
3 answers

You should not be in Release mode while you are debugging your code.

If you want to see variable values, you must be in Debug mode . Steps

  • Click on the name of your project in the upper left corner next to the start / stop buttons
  • Go to Edit scheme
  • Go to Run Settings
  • Go to Info tab and then Build Configuration
  • Set Debug

If on β€œRelease” it was that you saw all zero. If still not working, try running Build Settings in the project

  • Set Strip debug symbols during copy to NO
  • Optimization Level to None -O0
+4
source

Try installing Post-Processing Deployment NO inside the build settings and check.

+2
source

Make sure that for the "Debug" option in the build settings "

+2
source

Source: https://habr.com/ru/post/977410/