diff --git a/MASPreferencesWindowController.m b/MASPreferencesWindowController.m index 90b0266..66b5dfa 100644 --- a/MASPreferencesWindowController.m +++ b/MASPreferencesWindowController.m @@ -38,7 +38,11 @@ - (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title { if ((self = [super initWithWindowNibName:@"MASPreferencesWindow"])) { +#if __has_feature(objc_arc) + _viewControllers = viewControllers; +#else _viewControllers = [viewControllers retain]; +#endif _minimumViewRects = [[NSMutableDictionary alloc] init]; _title = [title copy]; } @@ -49,13 +53,13 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [[self window] setDelegate:nil]; - +#if !__has_feature(objc_arc) [_viewControllers release]; [_selectedViewController release]; [_minimumViewRects release]; [_title release]; - [super dealloc]; +#endif } #pragma mark - @@ -160,7 +164,10 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString toolbarItem.target = self; toolbarItem.action = @selector(toolbarItemDidClick:); } - return [toolbarItem autorelease]; +#if !__has_feature(objc_arc) + [toolbarItem autorelease]; +#endif + return toolbarItem; } #pragma mark - @@ -216,11 +223,17 @@ - (void)setSelectedViewController:(NSViewController