Skip to content

Commit

Permalink
Unbind the search controller before switching views
Browse files Browse the repository at this point in the history
Otherwise, the app will run fine in Debug mode but not when you
run it otherwise :|
  • Loading branch information
pieter committed Sep 20, 2008
1 parent ef6b506 commit 45ee18c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions PBCLIProxy.mm
Expand Up @@ -31,6 +31,7 @@ - (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(
// 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];
Expand Down
8 changes: 5 additions & 3 deletions PBGitWindowController.m
Expand Up @@ -40,7 +40,8 @@ - (void) setSelectedViewIndex: (int) i
- (void)changeViewController:(NSInteger)whichViewTag
{
[self willChangeValueForKey:@"viewController"];

self.searchController = nil;
[self unbind:@"searchController"];
if ([viewController view] != nil)
[[viewController view] removeFromSuperview]; // remove the current view

Expand All @@ -60,8 +61,9 @@ - (void)changeViewController:(NSInteger)whichViewTag

// 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]];

Expand Down

0 comments on commit 45ee18c

Please sign in to comment.