Unbind the search controller before switching views

Otherwise, the app will run fine in Debug mode but not when you
run it otherwise :|
This commit is contained in:
Pieter de Bie
2008-09-20 12:50:22 +02:00
parent ef6b506dc7
commit 45ee18c4f7
2 changed files with 6 additions and 3 deletions
+1
View File
@@ -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];
+5 -3
View File
@@ -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]];