diff --git a/PBViewController.h b/PBViewController.h index 9c15d69..6dae8af 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -16,6 +16,7 @@ NSString *status; BOOL isBusy; + BOOL hasViewLoaded; } @property (readonly) __weak PBGitRepository *repository; diff --git a/PBViewController.m b/PBViewController.m index d4c1832..717912e 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -27,14 +27,16 @@ return self; } -- (void) removeView +- (void)removeView { [self unbind:@"repository"]; - [[self view] removeFromSuperview]; // remove the current view + if (hasViewLoaded) + [[self view] removeFromSuperview]; // remove the current view } -- (void) awakeFromNib +- (void)awakeFromNib { + hasViewLoaded = YES; } - (NSResponder *)firstResponder;