mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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:
@@ -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];
|
||||
|
||||
@@ -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]];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user