Permalink
Browse files

Added an assertion to protect against subviews being added to TUINSView

  • Loading branch information...
1 parent f5ab5ef commit b363a4e914efe2caa13c4d2ff82961f521763b91 @jspahrsummers jspahrsummers committed Jul 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/UIKit/TUINSView.m
View
@@ -647,6 +647,11 @@ - (void)setUp {
[self recalculateNSViewClipping];
}
+- (void)didAddSubview:(NSView *)view {
+ NSAssert(view == self.tuiHostView || view == self.appKitHostView, @"Subviews should not be added to TUINSView %@: %@", self, view);
+ [super didAddSubview:view];
+}
+
#define ENABLE_NSTEXT_INPUT_CLIENT
#import "TUINSView+NSTextInputClient.m"
#undef ENABLE_NSTEXT_INPUT_CLIENT

0 comments on commit b363a4e

Please sign in to comment.