xcode 4.3无效断点

时间:2021-04-20 20:43:43

I'm having a breakpoint falsely getting hit. I have cleaned and rebuilt, deleted my project from the simulator and even tried rebooting but the problem persists. I have a breakpoint that stops ever time at the line "hasEstimateNumberChanged = YES;". However when I view the logs it does not print "inside hasEstimateNumberChanged test" to the console. And the log also displays "hasEstimateNumberChanged = 0". I'm at a loss at why it's hitting this.

我有一个断点错误地被击中。我已经清理并重建,从模拟器中删除了我的项目,甚至尝试重新启动但问题仍然存在。我有一个断点,在“hasEstimateNumberChanged = YES;”行停止。但是,当我查看日志时,它不会向控制台打印“inside hasEstimateNumberChanged test”。并且日志还显示“hasEstimateNumberChanged = 0”。我不知道为什么会这样。

        BOOL hasEstimateNumberChanged = NO;
        if (![survey.Code_Sub_Cmpy_Est isEqualToString:[estimateField1.text uppercaseString]] 
                || [survey.Nbr_Agt_Est compare:[NSDecimalNumber decimalNumberWithString:estimateField2.text]] != NSOrderedSame 
                || ![survey.Nbr_Est isEqualToString:[estimateField3.text uppercaseString]]) {

            NSLog(@"inside hasEstimateNumberChanged test");
            hasEstimateNumberChanged = YES;
        }  
        NSLog(@"hasEstimateNumberChanged = %d", hasEstimateNumberChanged);

1 个解决方案

#1


0  

Are you sure you're compiling with no optimizations (None [-O0])? That setting is normally associated with a debug scheme build configuration. Compiler optimizations can really confuse the debugger.

你确定你没有进行优化编译(无[-O0])吗?该设置通常与调试方案构建配置相关联。编译器优化实际上可能会混淆调试器。

#1


0  

Are you sure you're compiling with no optimizations (None [-O0])? That setting is normally associated with a debug scheme build configuration. Compiler optimizations can really confuse the debugger.

你确定你没有进行优化编译(无[-O0])吗?该设置通常与调试方案构建配置相关联。编译器优化实际上可能会混淆调试器。