本文介绍了无效断点与 xcode 4.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

        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);

推荐答案

您确定要在没有优化的情况下进行编译 (None [-O0])?该设置通常与调试方案构建配置相关联.编译器优化确实会混淆调试器.

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.

这篇关于无效断点与 xcode 4.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 04:11