From 45ee18c4f75ee35e8ebde7955df84d9546a01b27 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sat, 20 Sep 2008 12:50:22 +0200 Subject: [PATCH] Unbind the search controller before switching views Otherwise, the app will run fine in Debug mode but not when you run it otherwise :| --- PBCLIProxy.mm | 1 + PBGitWindowController.m | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PBCLIProxy.mm b/PBCLIProxy.mm index ca6ba32..27f3e22 100644 --- a/PBCLIProxy.mm +++ b/PBCLIProxy.mm @@ -31,6 +31,7 @@ // FIXME I found that creating this redundant NSURL reference was necessary to // work around an apparent bug with GC and Distributed Objects // I am not familiar with GC though, so perhaps I was doing something wrong. + NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]]; NSArray* arguments = [NSArray arrayWithArray:args]; PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 1a40152..bfe6f0a 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -40,7 +40,8 @@ - (void)changeViewController:(NSInteger)whichViewTag { [self willChangeValueForKey:@"viewController"]; - + self.searchController = nil; + [self unbind:@"searchController"]; if ([viewController view] != nil) [[viewController view] removeFromSuperview]; // remove the current view @@ -60,8 +61,9 @@ // Allow the viewcontroller to catch actions [self setNextResponder: viewController]; - [self bind:@"searchController" toObject:viewController withKeyPath:@"commitController" options:nil]; - + if ([viewController respondsToSelector:@selector(commitController)]) + [self bind:@"searchController" toObject:viewController withKeyPath:@"commitController" options:nil]; + // make sure we automatically resize the controller's view to the current window size [[viewController view] setFrame: [contentView bounds]];