Question

I've encountered a really strange behavior which I try to understand. While developing an iOS App using Xamarin, and two 3rd party libraries (One is a credit card reader - UniMag and a barcode scanner).

I am adding observers:

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

If I have a breakpoint in

void SwipeNotification (NSNotification notification)
    {
        string justForTheBreakPoint = "f";
    }

then everything works fine, if I remove it, then it's not. The app doesn't crash, just don't work as expected. I know its vague.

My question is, what does a breakpoint actually do that can effect the behavior of the app?

Was it helpful?

Solution

Usually when putting a breakpoint fixes an issue, means you have threading problems. By putting a breakpoint you're disrupting a running thread and allowing the other parallel threads to run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top