Skip to content

Commit be7f1b9

Browse files
committed
Added try/catch around the removeObserver call.
It seems that sometimes the controller wasn't observing bounds. That's no big issue, but we can't have it crash the app because of that. ;) Fixes ViewDeck#74.
1 parent 9e2e955 commit be7f1b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ViewDeck/IIViewDeckController.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,11 @@ - (void)viewWillDisappear:(BOOL)animated {
589589
- (void)viewDidDisappear:(BOOL)animated {
590590
[super viewDidDisappear:animated];
591591

592-
[self.view removeObserver:self forKeyPath:@"bounds"];
592+
@try {
593+
[self.view removeObserver:self forKeyPath:@"bounds"];
594+
} @catch(id anException){
595+
//do nothing, obviously it wasn't attached because an exception was thrown
596+
}
593597

594598
[self relayAppearanceMethod:^(UIViewController *controller) {
595599
[controller viewDidDisappear:animated];

0 commit comments

Comments
 (0)