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. --- Framework/MASShortcutView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Framework/MASShortcutView.m') 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; -- cgit v1.2.3