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
settingsInfo 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
Try setting Deployment Postprocessing to NO inside your Build Settings and check.
Make sure you have Link-Time Optimization
set to No for debug mode in Build Settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With