Add rs_enclosingTableView method as NSView category.
This commit is contained in:
parent
765a91dd34
commit
1b09d35c77
@ -27,5 +27,6 @@
|
||||
|
||||
- (NSRect)rs_rectCentered:(NSRect)originalRect;
|
||||
|
||||
- (NSTableView *)rs_enclosingTableView;
|
||||
|
||||
@end
|
||||
|
@ -65,4 +65,18 @@
|
||||
}
|
||||
|
||||
|
||||
- (NSTableView *)rs_enclosingTableView {
|
||||
|
||||
NSView *nomad = self.superview;
|
||||
|
||||
while (nomad != nil) {
|
||||
if ([nomad isKindOfClass:[NSTableView class]]) {
|
||||
return nomad;
|
||||
}
|
||||
nomad = nomad.superview;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user