From 86a32313986fb9da606df40bc937298b2abeed35 Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Fri, 9 Jan 2015 12:54:50 +0100 Subject: Added support for older OS X releases back to 10.6 included. Apart from turning off Auto Layout for the Demo project, the only thing remaining was several __weak qualifiers to prevent retain cycles in blocks. I have replaced them with __unsafe_unretained since __weak is not supported on 10.6. There should be no safety concerns here, since we are certain the pointers will remain valid. --- CHANGES | 3 +++ Demo/MainMenu.xib | 23 +++++++++++++++-------- Framework/MASShortcutView.m | 4 ++-- MASShortcut.xcodeproj/project.pbxproj | 4 ++++ 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 8237ae6..115c78f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +Unreleased yet + - Added support for older OS X versions down to 10.6 included. + 2.0.1 2015/1/9 - Trivial Podspec fix. diff --git a/Demo/MainMenu.xib b/Demo/MainMenu.xib index a04814d..a4bf180 100644 --- a/Demo/MainMenu.xib +++ b/Demo/MainMenu.xib @@ -1,5 +1,5 @@ - + @@ -655,19 +655,22 @@ - + + - + + - - + + - - + + - + + diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index aace67e..74e14de 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -369,7 +369,7 @@ void *kUserDataHint = &kUserDataHint; static id eventMonitor = nil; if (shouldActivate) { - __weak MASShortcutView *weakSelf = self; + __unsafe_unretained MASShortcutView *weakSelf = self; NSEventMask eventMask = (NSKeyDownMask | NSFlagsChangedMask); eventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^(NSEvent *event) { @@ -450,7 +450,7 @@ void *kUserDataHint = &kUserDataHint; static id observer = nil; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; if (shouldActivate) { - __weak MASShortcutView *weakSelf = self; + __unsafe_unretained MASShortcutView *weakSelf = self; observer = [notificationCenter addObserverForName:NSWindowDidResignKeyNotification object:self.window queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { weakSelf.recording = NO; diff --git a/MASShortcut.xcodeproj/project.pbxproj b/MASShortcut.xcodeproj/project.pbxproj index 2ab08a8..41b78d1 100644 --- a/MASShortcut.xcodeproj/project.pbxproj +++ b/MASShortcut.xcodeproj/project.pbxproj @@ -516,6 +516,7 @@ GCC_PREFIX_HEADER = Framework/Prefix.pch; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; @@ -533,6 +534,7 @@ GCC_PREFIX_HEADER = Framework/Prefix.pch; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; @@ -551,6 +553,7 @@ "$(inherited)", ); INFOPLIST_FILE = Demo/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -564,6 +567,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Demo/Prefix.pch; INFOPLIST_FILE = Demo/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; -- cgit v1.2.3