diff --git a/Afloat.m b/Afloat.m index eb5e297..e9f25cc 100644 --- a/Afloat.m +++ b/Afloat.m @@ -117,9 +117,8 @@ - (void) install { if (index < [menu numberOfItems] && ![[menu itemAtIndex:index] isSeparatorItem]) [menu insertItem:[NSMenuItem separatorItem] atIndex:index]; - [badge release]; - [_menuWithItems release]; _menuWithItems = nil; + _menuWithItems = nil; // Set up swizzling sendEvents: in NSApplication -------------- @@ -350,7 +349,6 @@ - (void) beginTrackingWindow:(NSWindow*) window { L0Log(@"tracker = %@ view = %@", tracker, v); - [tracker release]; } - (void) endTrackingWindow:(NSWindow*) window { diff --git a/Afloat.xcodeproj/project.pbxproj b/Afloat.xcodeproj/project.pbxproj index a0f940a..0a91b2a 100644 --- a/Afloat.xcodeproj/project.pbxproj +++ b/Afloat.xcodeproj/project.pbxproj @@ -333,7 +333,7 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0510; }; buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Afloat" */; compatibilityVersion = "Xcode 3.2"; @@ -502,14 +502,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); GCC_C_LANGUAGE_STANDARD = c99; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_GC = supported; + GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -533,14 +534,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_OBJC_GC = supported; + GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Afloat_Prefix.pch; @@ -561,6 +563,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; }; name = Debug; @@ -568,6 +572,8 @@ 1DEB914008733D840010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; }; name = Release; diff --git a/AfloatBadgeController.h b/AfloatBadgeController.h index f084185..835291a 100644 --- a/AfloatBadgeController.h +++ b/AfloatBadgeController.h @@ -22,7 +22,7 @@ typedef NSUInteger AfloatBadgeType; unsigned int enqueuedFades; } -@property(retain) NSWindow* parentWindow; +@property(strong) NSWindow* parentWindow; - (id) initAttachedToWindow:(NSWindow*) parentWindow; + (id) badgeControllerForWindow:(NSWindow*) w; diff --git a/AfloatBadgeController.m b/AfloatBadgeController.m index ef18421..7dae1fb 100644 --- a/AfloatBadgeController.m +++ b/AfloatBadgeController.m @@ -19,7 +19,7 @@ + (id) badgeControllerForWindow:(NSWindow*) w { if (panel) return panel; else - return [[[self alloc] initAttachedToWindow:w] autorelease]; + return [[self alloc] initAttachedToWindow:w]; } - (id) initAttachedToWindow:(NSWindow*) parentWindow { @@ -48,7 +48,6 @@ - (void) setParentWindow:(NSWindow*) newParent { if (_parentWindow) { [AfloatStorage removeSharedValueForWindow:_parentWindow key:kAfloatBadgeControllerKey]; - [_parentWindow release]; } if (newParent) { @@ -58,7 +57,6 @@ - (void) setParentWindow:(NSWindow*) newParent { // addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow]; - [newParent retain]; } _parentWindow = newParent; @@ -188,9 +186,5 @@ + (NSImage*) didEndKeepingAfloatBadge { } -- (void) dealloc { - self.parentWindow = nil; - [super dealloc]; -} @end diff --git a/AfloatNagPreferences.h b/AfloatNagPreferences.h index b2ac6a9..db9dbef 100644 --- a/AfloatNagPreferences.h +++ b/AfloatNagPreferences.h @@ -15,13 +15,12 @@ enum { typedef NSInteger AfloatNagAction; static id AfloatNagGetPreferenceForKey(CFStringRef key, Class cl) { - id obj = (id) CFPreferencesCopyAppValue(key, kAfloatNagPreferencesIdentifier); + id obj = (id) CFBridgingRelease(CFPreferencesCopyAppValue(key, kAfloatNagPreferencesIdentifier)); if (cl && obj && ![obj isKindOfClass:cl]) { - [obj release]; obj = nil; } - return [obj autorelease]; + return obj; } static BOOL AfloatNagGetBooleanForKey(CFStringRef key) { @@ -30,7 +29,7 @@ static BOOL AfloatNagGetBooleanForKey(CFStringRef key) { } static void AfloatNagSetPreferenceForKey(CFStringRef key, id obj) { - CFPreferencesSetAppValue(key, (CFPropertyListRef) obj, kAfloatNagPreferencesIdentifier); + CFPreferencesSetAppValue(key, (__bridge CFPropertyListRef) obj, kAfloatNagPreferencesIdentifier); CFPreferencesAppSynchronize(kAfloatNagPreferencesIdentifier); } diff --git a/AfloatPanel.m b/AfloatPanel.m index f2bf2cc..f7ed512 100644 --- a/AfloatPanel.m +++ b/AfloatPanel.m @@ -25,10 +25,6 @@ - (id) initWithFrame:(NSRect) frame { return self; } -- (void) dealloc { - [_image release]; - [super dealloc]; -} - (void) drawRect:(NSRect) r { [[NSColor clearColor] set]; NSRectFill(r); diff --git a/AfloatPanelController.h b/AfloatPanelController.h index de943ee..bf1b07b 100644 --- a/AfloatPanelController.h +++ b/AfloatPanelController.h @@ -27,7 +27,7 @@ typedef enum { - (IBAction) disableAllOverlays:(id) sender; -@property(retain) NSWindow* parentWindow; +@property(strong) NSWindow* parentWindow; @property CGFloat alphaValue; // @property(getter=isKeptAfloat) BOOL keptAfloat; @property AfloatWindowState windowState; diff --git a/AfloatPanelController.m b/AfloatPanelController.m index 65bd904..e2ccde0 100644 --- a/AfloatPanelController.m +++ b/AfloatPanelController.m @@ -43,7 +43,6 @@ - (void) setParentWindow:(NSWindow*) newParent { [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:_parentWindow]; - [_parentWindow release]; } if (newParent) { @@ -53,7 +52,6 @@ - (void) setParentWindow:(NSWindow*) newParent { addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow]; - [newParent retain]; } _parentWindow = newParent; @@ -98,13 +96,11 @@ + (id) panelControllerForWindow:(NSWindow*) w { if (panel) return panel; else - return [[[self alloc] initAttachedToWindow:w] autorelease]; + return [[self alloc] initAttachedToWindow:w]; } - (void) dealloc { [AfloatStorage removeSharedValueForWindow:self.parentWindow key:kAfloatPanelControllerKey]; - self.parentWindow = nil; - [super dealloc]; } - (IBAction) toggleWindow:(id) sender { diff --git a/AfloatScripting/AfloatScripting.xcodeproj/project.pbxproj b/AfloatScripting/AfloatScripting.xcodeproj/project.pbxproj index c86efaa..a68c0da 100644 --- a/AfloatScripting/AfloatScripting.xcodeproj/project.pbxproj +++ b/AfloatScripting/AfloatScripting.xcodeproj/project.pbxproj @@ -208,7 +208,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0510; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AfloatScripting" */; compatibilityVersion = "Xcode 3.2"; @@ -285,6 +285,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; @@ -301,6 +303,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -319,6 +323,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; diff --git a/AfloatScripting/AfloatScriptingAppDelegate.m b/AfloatScripting/AfloatScriptingAppDelegate.m index 7956299..7dd8b05 100644 --- a/AfloatScripting/AfloatScriptingAppDelegate.m +++ b/AfloatScripting/AfloatScriptingAppDelegate.m @@ -18,10 +18,9 @@ - (void) applicationDidFinishLaunching:(NSNotification*) n { - (void) rearmDeathTimer { if (deathTimer) { [deathTimer invalidate]; - [deathTimer release]; } - deathTimer = [[NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(deathTimerTicked:) userInfo:nil repeats:NO] retain]; + deathTimer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(deathTimerTicked:) userInfo:nil repeats:NO]; } - (void) deathTimerTicked:(NSTimer*) t { @@ -30,8 +29,6 @@ - (void) deathTimerTicked:(NSTimer*) t { - (void) dealloc { [deathTimer invalidate]; - [deathTimer release]; - [super dealloc]; } @end diff --git a/AfloatStorage.h b/AfloatStorage.h index 4a9dfee..fc98d41 100644 --- a/AfloatStorage.h +++ b/AfloatStorage.h @@ -14,7 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND @interface AfloatStorage : NSObject { NSMutableDictionary* _backingStorage; - id _delegate; + id __strong _delegate; NSArray* _persistedKeys; } @@ -31,7 +31,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - (NSMutableDictionary*) mutableDictionaryForWindow:(NSWindow*) w; -@property(assign) id delegate; +@property(strong) id delegate; @property(copy) NSArray* persistedKeys; - (void) removeValueForWindow:(NSWindow*) w key:(NSString*) k; diff --git a/AfloatStorage.m b/AfloatStorage.m index add7076..672859e 100644 --- a/AfloatStorage.m +++ b/AfloatStorage.m @@ -39,8 +39,6 @@ - (id) init { - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_backingStorage release]; - [super dealloc]; } - (id) valueForWindow:(NSWindow*) w key:(NSString*) k { diff --git a/AfloatWindowIdentifier.m b/AfloatWindowIdentifier.m index 4086e27..5e8336e 100644 --- a/AfloatWindowIdentifier.m +++ b/AfloatWindowIdentifier.m @@ -144,21 +144,15 @@ + (NSArray*) identifierSubclasses { return classes; } -- (void) dealloc { - self.category = nil; - self.key = nil; - - [super dealloc]; -} @synthesize category = _category, key = _key, canMatchMultipleWindows = _canMatchMultipleWindows; + (NSArray*) allIdentifiersForWindow:(NSWindow*) w { - NSMutableArray* results = [NSArray array]; + NSMutableArray* results = [NSMutableArray array]; for (Class c in [self identifierSubclasses]) { if ([c canInitWithWindow:w]) - [results addObject:[[[c alloc] initWithWindow:w] autorelease]]; + [results addObject:[[c alloc] initWithWindow:w]]; } return results; diff --git a/Afloat_AfloatScripting.m b/Afloat_AfloatScripting.m index e680b78..ebb793b 100644 --- a/Afloat_AfloatScripting.m +++ b/Afloat_AfloatScripting.m @@ -58,7 +58,7 @@ - (void) installScriptingSupport { [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldShowWindowFileInFinder:) name:kAfloatScriptShowWindowFileInFinderNotification object:kAfloatScriptWireObject]; NSString* pathToScriptingApp = [[[[NSBundle bundleForClass:[self class]] bundlePath] stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Afloat Scripting.app"]; - LSRegisterURL((CFURLRef) [NSURL fileURLWithPath:pathToScriptingApp], false); + LSRegisterURL((__bridge CFURLRef) [NSURL fileURLWithPath:pathToScriptingApp], false); L0LogS(@"Scripting support installed."); }