使用断点的Monotouch怪异行为

时间:2014-03-16 14:14:16

标签: xamarin.ios xamarin

我遇到了一个非常奇怪的行为,我试图理解。 在使用Xamarin和两个第三方库(一个是信用卡读卡器 - UniMag和条形码扫描仪)开发iOS应用程序时。

我正在加入观察员:

var center = NSNotificationCenter.DefaultCenter;
        center.AddObserver ("uniMagAttachmentNotification", Attached);
        center.AddObserver ("uniMagDidConnectNotification", Connected);
        center.AddObserver ("uniMagSwipeNotification", SwipeReady);
        center.AddObserver ("uniMagDidReceiveDataNotification", DataProcess);
        center.AddObserver ("uniMagSystemMessageNotification", UnimagSystemMessage);
        center.AddObserver ("uniMagDataProcessingNotification", DataProcessNot);
        center.AddObserver ("uniMagInvalidSwipeNotification", InvalidSwipe);
        center.AddObserver ("uniMagSwipeNotification", SwipeNotification);

如果我在

中有断点
void SwipeNotification (NSNotification notification)
    {
        string justForTheBreakPoint = "f";
    }

然后一切正常,如果我删除它,那么它不是。该应用程序不会崩溃,只是没有按预期工作。我知道它含糊不清。

我的问题是,断点实际上做了什么会影响应用的行为?

1 个答案:

答案 0 :(得分:1)

通常在设置断点时修复问题,意味着您遇到了线程问题。通过设置断点,您可以中断正在运行的线程并允许其他并行线程运行。

相关问题