From 65dcba5b7d5fbfcd2045281e4941fd48136c8ae3 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Mon, 16 Mar 2015 11:04:15 +0800 Subject: [PATCH] Disable live scroll notifications on OS X 10.8 NSScrollViewDidEndLiveScrollNotification is available only on 10.9 onwards. Will probably need to find another way to implement this in MacDown 0.4.5, but for now let's just perform version-sniffing as a stop-gap. Ref #241, close #311 --- MacDown/Code/Document/MPDocument.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MacDown/Code/Document/MPDocument.m b/MacDown/Code/Document/MPDocument.m index c32095e1..82b53c81 100644 --- a/MacDown/Code/Document/MPDocument.m +++ b/MacDown/Code/Document/MPDocument.m @@ -399,9 +399,12 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller name:MPDidRequestEditorSetupNotification object:nil]; [center addObserver:self selector:@selector(didRequestPreviewReload:) name:MPDidRequestPreviewRenderNotification object:nil]; - [center addObserver:self selector:@selector(previewDidLiveScroll:) - name:NSScrollViewDidEndLiveScrollNotification - object:self.preview.enclosingScrollView]; + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_9) + { + [center addObserver:self selector:@selector(previewDidLiveScroll:) + name:NSScrollViewDidEndLiveScrollNotification + object:self.preview.enclosingScrollView]; + } self.wordsMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:@""];