Xcode 6 strange (null) object display in debugger

I'm seeing a strange behavior with Xcode 6 debugger. I have created a singleton shared 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;
}

Right after the object is initialized by calling the method like this:

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

I have placed a breakpoint on the "NSLog", and i'm seeing the following debugger status:

Xcode 6调试器屏幕截图

I have made sure I'm launching on debug mode, and that the build settings are fine, following the question here: Xcode debugger doesn't print objects and shows nil, when they aren't

Any ideas on why this is happening? This is the first time i have ever seen this kind of strange behavior. Any help would be much 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.

You shouldn't be in Release mode while you are debugging your code.

If you want to see variable values you have to be in Debug mode . The steps are

  • Click on your project name on the top left corner near start/stop buttons
  • Go in Edit scheme
  • Go in Run settings
  • Go in Info tab and then Build Configuration
  • Set it to Debug
  • If it was on "Release" that's the matter you saw all nil. If still not working then try following in the project Build Settings

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

  • 尝试在您的构建设置中将部署后处理设置为NO并检查。


    确保您在生成设置中将调试模式的Link-Time Optimization设置为否。

    链接地址: http://www.djcxy.com/p/68684.html

    上一篇: 隐藏奇怪的不需要的Xcode日志

    下一篇: Xcode 6奇怪的(空)对象显示在调试器中