From be9358bf32dc402f3bc77c6cc20957047ab363af Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Thu, 7 Aug 2014 10:10:08 +0200 Subject: Turned MASShortcutMonitor into a singleton. There can only be one Carbon event handler, so it doesn’t make sense to create multiple instances of the shortcut monitor. --- Demo/AppDelegate.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Demo') diff --git a/Demo/AppDelegate.m b/Demo/AppDelegate.m index d2c07ba..81b2661 100644 --- a/Demo/AppDelegate.m +++ b/Demo/AppDelegate.m @@ -16,8 +16,7 @@ NSString *const MASPreferenceKeyConstantShortcutEnabled = @"MASDemoConstantShort [super awakeFromNib]; _shortcutBinder = [[MASShortcutBinder alloc] init]; - _shortcutMonitor = [[MASShortcutMonitor alloc] init]; - [_shortcutBinder setShortcutMonitor:_shortcutMonitor]; + _shortcutMonitor = [MASShortcutMonitor sharedMonitor]; // Checkbox will enable and disable the shortcut view [self.shortcutView bind:@"enabled" toObject:self withKeyPath:@"shortcutEnabled" options:nil]; -- cgit v1.2.3