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:
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
Edit scheme
Run
settings Info tab
and then Build Configuration
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
Strip debug symbols during copy
to NO
Optimization Level
to None -O0
尝试在您的构建设置中将部署后处理设置为NO并检查。
确保您在生成设置中将调试模式的Link-Time Optimization
设置为否。
上一篇: 隐藏奇怪的不需要的Xcode日志