From d795f929340b93b1ee55e06d2d1581ba4c35a3cc Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sat, 13 Aug 2011 19:35:26 +0200 Subject: [PATCH] Switch to garbage collection to fix crash for NSTokenFieldCell --- Medianno.xcodeproj/project.pbxproj | 2 ++ Medianno/MAAddMediaSheet.mm | 5 ----- Medianno/MADocWindow.mm | 6 +++++- Medianno/MADocument.mm | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Medianno.xcodeproj/project.pbxproj b/Medianno.xcodeproj/project.pbxproj index d6cb28d..d5cf6e5 100644 --- a/Medianno.xcodeproj/project.pbxproj +++ b/Medianno.xcodeproj/project.pbxproj @@ -346,6 +346,7 @@ 950BB68B13F1F26200D8E669 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_ENABLE_OBJC_GC = required; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Medianno/Medianno-Prefix.pch"; INFOPLIST_FILE = "Medianno/Medianno-Info.plist"; @@ -358,6 +359,7 @@ 950BB68C13F1F26200D8E669 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_ENABLE_OBJC_GC = required; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Medianno/Medianno-Prefix.pch"; INFOPLIST_FILE = "Medianno/Medianno-Info.plist"; diff --git a/Medianno/MAAddMediaSheet.mm b/Medianno/MAAddMediaSheet.mm index c958cdb..eaa9002 100644 --- a/Medianno/MAAddMediaSheet.mm +++ b/Medianno/MAAddMediaSheet.mm @@ -45,11 +45,6 @@ }]; } -- (void)dealloc -{ - [media release]; -} - - (IBAction)useModificationDates:(id)sender { for (NSMutableDictionary * m in media) { diff --git a/Medianno/MADocWindow.mm b/Medianno/MADocWindow.mm index 6028232..8157859 100644 --- a/Medianno/MADocWindow.mm +++ b/Medianno/MADocWindow.mm @@ -26,7 +26,11 @@ [super windowDidLoad]; [mediaController setSortDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]]]; [annotationController setSortDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"location" ascending:YES]]]; - NSCell * tokenCell = [tokenFieldProto cell]; + NSTokenFieldCell * tokenCellProto = [tokenFieldProto cell]; + NSTokenFieldCell * tokenCell = [[NSTokenFieldCell alloc] init]; + [tokenCell setDelegate:self]; + [tokenCell setFont:[tokenCellProto font]]; + [tokenCell setTokenizingCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@";"]]; [tokenColumn setDataCell:tokenCell]; } diff --git a/Medianno/MADocument.mm b/Medianno/MADocument.mm index df35cd3..0004f30 100644 --- a/Medianno/MADocument.mm +++ b/Medianno/MADocument.mm @@ -45,7 +45,6 @@ { MADocWindow * windowController = [[MADocWindow alloc] initWithWindowNibName:[self windowNibName]]; [self addWindowController:windowController]; - [windowController release]; } + (BOOL)autosavesInPlace